Bug #80692
closedDeleting old files fails
100%
Description
I cannot delete an old file, which once was referenced but isn't anymore. I only see a warning like this:
File not deleted
The file cannot be deleted since it is still used at the following places: [record:...]
What I found out until now:
- records in "sys_file_references" exist, but are marked with "deleted=1"
- existing file references are checked against "sys_refindex" and not "sys_file_references", before they can be deleted
- the reference index contains deleted records
Maybe the check before deleting a file should not check against the reference index, but check the real file references?
Updated by Frans Saris over 7 years ago
- Status changed from New to Needs Feedback
Sys_refindex can also hold valid references (other then sys_file_reference) that should block deleting.
If I remember correctly the delete check is done against both tables.
Does deleting a file still fail if you run the refindex updater?
Excluding the deleted sys_file_reference records could make sense if that's currently not the case. But not sure when they get flagged deleted?
In latest 7.6 I could just remove a file after deleting a single sys_file_reference or deleting a record with sys_file_reference's linked to it.
Updated by Albrecht Köhnlein over 7 years ago
Frans Saris wrote:
Does deleting a file still fail if you run the refindex updater?
I ran the refindex updater. I truncated the sys_refindex table and rebuilt it again with the refindex updater. - Still the same problem.
Updated by Frans Saris over 7 years ago
- Status changed from Needs Feedback to Accepted
We need to check the code of 7.6 against 8.7 to see if there was something changed in the logic with the doctrine migration
Updated by Frans Saris over 7 years ago
- Is Regression changed from No to Yes
just checked behavior between 7LTS and 8LTS. And in 8 the "deleted" sys_file_references indeed block deleting the file. Where this wasn't the case in 7LTS.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52387
Updated by Frans Saris over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2aa304eb05e029f3a3fae1ff2b83416d6d522e3e.
Updated by Andreas Allacher over 7 years ago
- Is duplicate of Bug #80152: Filelist: File can not be deleted if it was reference once added