[BUGFIX] Processed files get corrupted when regenerated
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / ProcessedFile.php
index 2ee5498..40d6338 100644 (file)
@@ -417,13 +417,23 @@ class ProcessedFile extends AbstractFile {
         * @return mixed
         */
        public function getProperty($key) {
-               if ($this->isUnchanged()) {
+               // The uid always (!) has to come from this file and never the original file (see getOriginalFile() to get this)
+               if ($this->isUnchanged() && $key !== 'uid') {
                        return $this->originalFile->getProperty($key);
                } else {
                        return $this->properties[$key];
                }
        }
 
+       /**
+        * Returns the uid of this file
+        *
+        * @return int
+        */
+       public function getUid() {
+               return $this->properties['uid'];
+       }
+
 
        /**
         * Checks if the ProcessedFile needs reprocessing