[BUGFIX] Processed files get corrupted when regenerated 45/18145/3
authorAndreas Wolf <andreas.wolf@typo3.org>
Sat, 9 Feb 2013 10:02:05 +0000 (11:02 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 9 Feb 2013 11:09:19 +0000 (12:09 +0100)
commit5516c309ad6196a6664b0e8d52f5073da846b352
tree22a7521170a29754bea818dfe194cd2013783dfe
parent533d9b29df451a3856b5e8ff4ff367bb3935de26
[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
typo3/sysext/core/Classes/Resource/ProcessedFile.php
typo3/sysext/core/Classes/Resource/ProcessedFileRepository.php