Bug #39884

Cannot reference to a file after changing it's title

Added by Mario Rimann 9 months ago. Updated 9 months ago.

Status:Resolved Start date:2012-08-17
Priority:Must have Due date:
Assignee:- % Done:

100%

Category:File Abstraction Layer (FAL)
Target version:-
TYPO3 Version:6.0 Complexity:
PHP Version:
Votes: 0

Description

As long as the title of a file is not modified (= is equal to the filename), all is fine and using e.g. images in content elements works fine. As soon as the title of an image is changed, this file cannot be used in a content element anymore.

Steps to reproduce:

  1. Go to the file-list module and upload a file (tested with an image)
  2. modify the title of the file
  3. Go to the list module
  4. Create a content element of type "images"
  5. Link to the image you've uploaded
  6. Save the content element
  7. Look at the tab "Images" in that CE again

When the title of the image is not changed, all is fine.
As soon as the title of the image is once modified, referencing to that image is not possible anymore and the reference is not saved (e.g. the image tab in the CE is empty again after saving and the reference is completely lost)

Problem can be reproduced both as editor and as admin user on today's Git master.

Might be related to #39859


Related issues

related to Core - Bug #39859: No thumbnail if removing file extension from title Resolved 2012-08-16
related to Core - Bug #36795: Changing the "title" of a file breaks some functionality Resolved 2012-05-03

Associated revisions

Revision d4f101a0
Added by Andreas Wolf 9 months ago

[BUGFIX] Changing file title changes file name

The TCA configuration of sys_file allows direct editing of the file
name. As t3lib_TCEmain does not recognize this change as a
filesystem-related change on saving, the file is not renamed on disk.
Instead, the index record is changed, so the file is not recognized
anymore, leading to a reindexing. Because of this, all references to the
old record seem to break.

This commit makes the name field read-only and adds the title field
(which is not present in the TCA at all currently).

Change-Id: Ice110fa7ea0cc335f8b9fa8a57ecc9fe7527de76
Resolves: #39884
Resolves: #36795
Resolves: #39859
Releases: 6.0
Reviewed-on: http://review.typo3.org/14260
Reviewed-by: Mario Rimann
Tested-by: Mario Rimann
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

History

Updated by Andreas Wolf 9 months ago

  • Project changed from File Abstraction Layer to Core

Updated by Andreas Wolf 9 months ago

  • Category set to File Abstraction Layer (FAL)
  • TYPO3 Version set to 6.0

Updated by Andreas Wolf 9 months ago

  • Status changed from New to Accepted

I can confirm this weird bug. It seems that the title of a file is saved in the "name" field instead of the title field - and this field is also updated. This leads to the file being reindexed (which is bad) and to reference records breaking (which is worse).

Another problem is that BE users are not allowed to edit sys_file_reference records – at least this is an error I had while testing this. We had a similar problem with sys_file which has been fixed in the meantime.

Updated by Gerrit Code Review 9 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14260

Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14260

Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/14260

Updated by Anonymous 9 months ago

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

Also available in: Atom PDF