[BUGFIX] Moving folders fails 92/24792/3
authorOliver Hader <oliver@typo3.org>
Tue, 15 Oct 2013 12:38:43 +0000 (14:38 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 15 Oct 2013 12:58:42 +0000 (14:58 +0200)
On moving existing folders inside another existing folder in the
file-module, the following exception is thrown:

1314085991: uid of Storage has to be numeric.

The reason is obvious, since the submitted storage key contains
the storage object instead of the UID of the storage.

Change-Id: Ia6f6af5252880a7bde8a537bc9e343c392eadbf5
Fixes: #52845
Releases: 6.0, 6.1, 6.2
Reviewed-on: https://review.typo3.org/24792
Reviewed-by: Xavier Perseguers
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 1d455c5..c40e7f3 100644 (file)
@@ -1642,7 +1642,7 @@ class ResourceStorage {
                // Update the identifier and storage of all file objects
                foreach ($fileObjects as $oldIdentifier => $fileObject) {
                        $newIdentifier = $fileMappings[$oldIdentifier];
-                       $fileObject->updateProperties(array('storage' => $this, 'identifier' => $newIdentifier));
+                       $fileObject->updateProperties(array('storage' => $this->getUid(), 'identifier' => $newIdentifier));
                        $this->getFileIndexRepository()->update($fileObject);
                }
                $returnObject = $this->getFolder($fileMappings[$folderToMove->getIdentifier()]);