[BUGFIX] Moving folders fails 00/24800/2
authorOliver Hader <oliver@typo3.org>
Tue, 15 Oct 2013 12:38:43 +0000 (14:38 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 15 Oct 2013 14:48:15 +0000 (16:48 +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/24800
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 4bc2c78..7fe6655 100644 (file)
@@ -1626,7 +1626,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->getFileRepository()->update($fileObject);
                }
                $returnObject = $this->getFolder($fileMappings[$folderToMove->getIdentifier()]);