Bug #72539
closedExtbase: sys_file_reference not deleted with repository-function
0%
Description
The sys_file_reference is not updated if detach a file from an objectstorage. If you try to delete the sys_file_reference with the repository, it tries to delete the sys_file with the uid from the sys_file_reference.
private function detachFilerefernce(\TYPO3\CMS\Extbase\Domain\Model\FileReference $file) {
$fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
$ref = $fileRepository->findByUid($file->getUid());
$ref->delete();
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
There is no core repository for file references, only for files - and deleting via that repository should delete the file (not a reference).
This looks like an implementation problem in a custom project - for help with these please ask on slack. If you think this is a bug, please reopen the issue.