Clicking on a deleted image in the asset admin gallery results in an error (see below).
It should instead still give you the normal file edit form (you can see that if you follow the reproduction steps with a non-image file, e.g. a pdf)
ERROR [Emergency]: Uncaught Error: Call to a member function getAllowsAnimationInManipulations() on null
IN GET /admin/assets/schema/fileEditForm/192
Line 113 in /var/www/html/vendor/silverstripe/assets/src/Image.php
Trace
=====
SilverStripe\Assets\Image->PreviewLink()
PreviewImageField.php:50
SilverStripe\AssetAdmin\Forms\PreviewImageField->getSchemaStateDefaults()
FormField.php:1542
SilverStripe\Forms\FormField->getSchemaState()
FormSchema.php:211
... omitted for brevity
Either we should only call getAllowsAnimationInManipulations() if $this->exists() is true, or getAllowsAnimationInManipulations() should itself check exists().
This was seen in the 3 branch but is probably the case in 3.1 as well.
This won't happen in CMS 5 because getAllowsAnimationInManipulations() doesn't exist there.
Reproduction steps
- In
/admin/assets upload an image
- Physically delete the image from your filesystem without removing it from the database
- Reload the page
- Click on the image record in the gallery
Clicking on a deleted image in the asset admin gallery results in an error (see below).
It should instead still give you the normal file edit form (you can see that if you follow the reproduction steps with a non-image file, e.g. a pdf)
Either we should only call
getAllowsAnimationInManipulations()if$this->exists()is true, or getAllowsAnimationInManipulations() should itself checkexists().This was seen in the
3branch but is probably the case in3.1as well.This won't happen in CMS 5 because
getAllowsAnimationInManipulations()doesn't exist there.Reproduction steps
/admin/assetsupload an image