[BUGFIX] Fix fileinfo property mapping in ResourceStorage::setFileContents 12/23712/2
authorThomas Maroschik <tmaroschik@dfau.de>
Mon, 24 Jun 2013 14:33:02 +0000 (16:33 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 9 Sep 2013 20:35:21 +0000 (22:35 +0200)
Fixes the handling of the mismatch between the file info property
"mimetype" and the file object property "mime_type" by using the
exposed API methods.

Fixes: #49386
Releases: 6.2, 6.1, 6.0
Change-Id: If948de2a8bead340ae97097b3e4e391a27296362
Reviewed-on: https://review.typo3.org/23712
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 5944057..4ca88d4 100644 (file)
@@ -1314,10 +1314,8 @@ class ResourceStorage {
                $this->assureFileWritePermissions($file);
                // Call driver method to update the file and update file properties afterwards
                $result = $this->driver->setFileContents($file, $contents);
-               $fileInfo = $this->driver->getFileInfo($file);
-               $fileInfo['sha1'] = $this->driver->hash($file, 'sha1');
-               $file->updateProperties($fileInfo);
-               $this->getFileRepository()->update($file);
+               $file->updateProperties(array('sha1' => $this->driver->hash($file, 'sha1')));
+               $this->updateFile($file);
                return $result;
        }