When a gallery content element is linked to a deleted image file collection, previewing it in the backend will lead to an exception:
(1/1) TypeError
Argument 2 passed to TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord()
must be of the type array, null given, called in
typo3conf/ext/generic_gallery/Classes/Backend/Hooks/PageLayoutViewHook.php on line 251
Viewing the page in the frontend leads to a different error:
(1/1) #1314085992 InvalidArgumentException
No collection found for given UID: "25"
in typo3/sysext/core/Classes/Resource/ResourceFactory.php line 329
This patch fixes both exceptions by
a) not rending the backend preview for the file collection record b) pretending there are no images to render in the frontend
This bug can be reproduced as follows:
Create generic gallery content element
In the element details, add image collection and provide a title
Save the content element and close
On the typo3 content element preview, click the collection icon. A context menu opens.
When a gallery content element is linked to a deleted image file collection, previewing it in the backend will lead to an exception:
Viewing the page in the frontend leads to a different error:
This patch fixes both exceptions by a) not rending the backend preview for the file collection record b) pretending there are no images to render in the frontend
This bug can be reproduced as follows:
Related: https://github.com/fnagel/generic-gallery/pull/47