Issue Bug Closed

#72539Extbase: sys_file_reference not deleted with repository-function

Felix Herrmann 01/05/16, 13:08 updated 03/05/20, 09:01

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();

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.