mullema / k3-image-clip

Visually crop images with a handy image editor directly inside the panel
MIT License
40 stars 4 forks source link

Error message after updating to Kirby 3.7 #22

Closed holamon closed 2 years ago

holamon commented 2 years ago

After updating to Kirby 3.7 and k3-image-clip 3.1, I started seeing an error message in all blocks where I use Image Clip:

Argument 1 passed to mullema\File::setClip() must be of the type array, null given, called in /site/site/plugins/k3-image-clip/fieldMethods/toImages.php on line 38

I could fix the error message by passing an empty array instead of null to setClip on the toImages method, line 38:

from $clipfile->setClip($clip ?? null); to $clipfile->setClip($clip ?? []);

I am not sure if this change has any repercussions elsewhere so I preferred to create this issue instead of opening a pull request, I hope this is ok!