Bug #53672

Files can not be deleted anymore

Added by Martin Holtz almost 6 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2013-11-15
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I uploaded an image for testing purpose on a TYPO3 6.2beta1 Web. And directly after that i wanted do delete the file again. But that is not possible, because "The file cannot be deleted since it is still used at the following places:"

But i just uploaded the file, i did not used it and the list of places is empty.

53672_references_to_this_item.png View (5.76 KB) Martin Holtz, 2013-11-15 15:59

Associated revisions

Revision 95e8e330 (diff)
Added by Frans Saris almost 6 years ago

[BUGFIX] Can not delete Files with metadata records

When a sys_file record has relation with a sys_file_metadata
record the file can not be deleted.

This patch excludes tables sys_file_metadata from the
reference check.

Resolves: #53672
Releases: 6.2
Change-Id: Ib7a5b55fce9f5cf19ffe3b18eddfc7238a8e8626
Reviewed-on: https://review.typo3.org/25456
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Fabien Udriot
Reviewed-by: Markus Klein
Tested-by: Markus Klein

History

#1 Updated by Martin Holtz almost 6 years ago

I had a look into the database, i have two records uid 8 and uid 14 with the same image. And the image seems to reference to itself... somehow. See attached image.

#2 Updated by Martin Holtz almost 6 years ago

Martin Holtz wrote:

I had a look into the database, i have two records uid 8 and uid 14 with the same image. And the image seems to reference to itself... somehow. See attached image.

Ok, now i get it. The reference is sys_file_metadata:8:file. I tried to delete that record via database, which does not help. The metadata record is created automatically before i can delete the record.

#3 Updated by Steffen Ritter almost 6 years ago

  • Subject changed from recently uploaded file can not be deleted. to Files can not be deleted anymore
  • Status changed from New to Accepted
  • Priority changed from Should have to Must have
  • Target version set to 6.2.0

the reference check must exclude tables sys_file_metadata and sys_category as these are not usages

#4 Updated by Gerrit Code Review almost 6 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/25456

#5 Updated by Frans Saris almost 6 years ago

The provided patch in gerrit is easy to test.

Edit de file info (title, description etc) of a new uploaded file in the filemodule and after save try to delete the file.

#6 Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25456

#7 Updated by Markus Klein almost 6 years ago

Testing instructions:

  • Upload file in Filelist via d&d for instance
  • Edit it once and save+close it. (no need to change anything, just to create the refindex)
  • try to delete the file

#8 Updated by Frans Saris almost 6 years ago

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

#9 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF