Deleting a file with broken references via BE module not possible
A file with broken FAL references cannot get deleted via the TYPO3 backend module File>Filelist. Such broken references for instance could occure after a manual data migration/import or deletion of one or more referenced records by executing db queries via command line.
Currently, a fatal error occures in cause of that $shortcutRecord is NULL and not type of array but is passed as the second argument of method \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord().
A redactor which only has access to files via BE module wouldn't be able to delete such a physical file but would see a thrown error .
This patch  will solve this issue by deleting the file with corrupt relations anyway and outputting a common flash message by informing about there were broken references .
Updated by Cornel Boppart over 9 years ago
Frans Saris wrote:
Is running the update references commandant in the DB tools module not enough to cleanup the references?
Updating the reference index does not help in this case. Apart from that, the System Module with all the DB tools inside is accessible for admins only.To reproduce the error or testing the patch you can do this following few steps:
- Create an image or textpic element
- Add an image to that element and save
- Now, delete the tt_content record from DB via command line or e.g. phpmyadmin
- Go to Module File>Filelist in Backend and try to delete that image which was added to the content element