Project

General

Profile

Actions

Bug #80692

closed

Deleting old files fails

Added by Albrecht Köhnlein about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2017-04-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #80152: Filelist: File can not be deleted if it was reference onceClosed2017-03-06

Actions
Actions #1

Updated by Frans Saris about 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.

Actions #2

Updated by Albrecht Köhnlein about 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.

Actions #3

Updated by Frans Saris about 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

Actions #4

Updated by Frans Saris about 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.

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Frans Saris about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Andreas Allacher almost 7 years ago

  • Is duplicate of Bug #80152: Filelist: File can not be deleted if it was reference once added
Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF