[BUGFIX] Initiate correct storage of processed file during reconstitution 27/55927/3
authorFrans Saris <franssaris@gmail.com>
Tue, 27 Feb 2018 16:07:25 +0000 (17:07 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Wed, 28 Feb 2018 12:08:36 +0000 (13:08 +0100)
Releases: master, 8.7
Resolves: #84069
Change-Id: Idd642770341ddd5513c650e5ae230bcb5e7e6824
Reviewed-on: https://review.typo3.org/55927
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wolfgang Klinger <wolfgang@wazum.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Resource/ProcessedFile.php

index b97fd11..7119620 100644 (file)
@@ -129,7 +129,6 @@ class ProcessedFile extends AbstractFile
      * Creates a ProcessedFile object from a database record.
      *
      * @param array $databaseRow
-     * @return ProcessedFile
      */
     protected function reconstituteFromDatabaseRecord(array $databaseRow)
     {
@@ -140,6 +139,10 @@ class ProcessedFile extends AbstractFile
         $this->identifier = $databaseRow['identifier'];
         $this->name = $databaseRow['name'];
         $this->properties = $databaseRow;
+
+        if (!empty($databaseRow['storage']) && (int)$this->storage->getUid() !== (int)$databaseRow['storage']) {
+            $this->storage = ResourceFactory::getInstance()->getStorageObject($databaseRow['storage']);
+        }
     }
 
     /********************************