Bug #45308

uid of processed file is sometimes updated during processing

Added by Andreas Wolf over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2013-02-09
Priority:Must have Due date:
Assigned To:Andreas Wolf % Done:

100%

Category:File Abstraction Layer (FAL) Spent time: -
Target version:6.0.2
TYPO3 Version:6.0 Is Regression:
PHP Version: Sprint Focus:
Complexity:

Description

After a file is being (re)processed, the information about it is stored in the database again. This is done by the ProcessedFileRepository. The repository gathers information for the update from the processed file.

For files that are not changed (i.e. used as they are), the ProcessedFile class does a fallback to the original file object. Unfortunately, this uses the uid of the original file, as the ProcessedFile class does also do the fallback here. This leads to some random (well, not really random) record in sys_file_processedfile being overwritten with the information of the processed file.

The fix is quite simple: The processed file class should never return the uid of the original file, but always its own one if it has been persisted before, otherwise simply NULL.


Related issues

related to Core - Bug #44616: Image caching broken for im_noScaleUp = 1 Closed 2013-01-17
related to Core - Bug #45168: Wrong image displayed in FE if not resized Resolved 2013-02-05

Associated revisions

Revision 5516c309
Added by Andreas Wolf over 2 years ago

[BUGFIX] Processed files get corrupted when regenerated

After a file is being (re)processed, the information about it is updated
in the database by the ProcessedFileRepository. The repository gathers
information for the update from the processed file.

For unprocessed files (i.e. those where the original file should be
used), the ProcessedFile class does a fallback to the original file
object. Unfortunately, this fallback is also applied for the uid
property, which makes the repository overwrite a random record in
sys_file_processedfile. This leads to wrong images being displayed in
the frontend.

This patch makes the processed file only return its own uid.

IMPORTANT: To make sure your sys_file_processedfile data is not
corrupted, empty the table and your processed files folder (usually
fileadmin/_processed_/). This will slow down your site as all processed
files are regenerated, but afterwards all data will be correct.

Change-Id: I40685d5748a5a0fcf015c7d876a374f42154831d
Resolves: #45308
Related: #44616 #45168
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/18145
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 91a1d0a3
Added by Andreas Wolf over 2 years ago

[BUGFIX] Processed files get corrupted when regenerated

After a file is being (re)processed, the information about it is updated
in the database by the ProcessedFileRepository. The repository gathers
information for the update from the processed file.

For unprocessed files (i.e. those where the original file should be
used), the ProcessedFile class does a fallback to the original file
object. Unfortunately, this fallback is also applied for the uid
property, which makes the repository overwrite a random record in
sys_file_processedfile. This leads to wrong images being displayed in
the frontend.

This patch makes the processed file only return its own uid.

IMPORTANT: To make sure your sys_file_processedfile data is not
corrupted, empty the table and your processed files folder (usually
fileadmin/_processed_/). This will slow down your site as all processed
files are regenerated, but afterwards all data will be correct.

Change-Id: I40685d5748a5a0fcf015c7d876a374f42154831d
Resolves: #45308
Related: #44616 #45168
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/18153
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf

History

#1 Updated by Andreas Wolf over 2 years ago

  • Subject changed from uid of processed file may be updated during processing to uid of processed file is sometimes updated during processing

#2 Updated by Gerrit Code Review over 2 years 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 https://review.typo3.org/18145

#3 Updated by Gerrit Code Review over 2 years ago

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

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/18153

#5 Updated by Anonymous over 2 years ago

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

Also available in: Atom PDF