[BUGFIX] Processed files get corrupted when regenerated 53/18153/2
authorAndreas Wolf <andreas.wolf@typo3.org>
Sat, 9 Feb 2013 10:02:05 +0000 (11:02 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sat, 9 Feb 2013 11:23:17 +0000 (12:23 +0100)
commit91a1d0a35fd6b7eedabc90b1238a8c6b0a5074f5
treebfd526fd0d7530f50d20c3e496eeb16d65275544
parent287acf50178f804339acb839429de96818138f8d
[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
typo3/sysext/core/Classes/Resource/ProcessedFile.php
typo3/sysext/core/Classes/Resource/ProcessedFileRepository.php