[BUGFIX] Renaming files on non LocalDriver storages 21/55421/4
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 21 Jan 2018 17:37:49 +0000 (18:37 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 29 Mar 2018 12:31:11 +0000 (14:31 +0200)
Fixing determination of the parent folder of a file inside the
storage, so it can be used as destination for the renaming.

Resolves: #83628
Releases: master, 8.7
Change-Id: I2b905dc7ba5e3d6fa8bec2b5a728d27f3c4a3258
Reviewed-on: https://review.typo3.org/55421
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
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/backend/Classes/Controller/File/RenameFileController.php

index 2369b98..2e0e64a 100644 (file)
@@ -204,7 +204,7 @@ class RenameFileController
             $fileIdentifier = $this->fileOrFolderObject->getUid();
             $targetLabel = 'file_rename.php.label.target.file';
             $assigns['conflictMode'] = DuplicationBehavior::cast(DuplicationBehavior::RENAME);
-            $assigns['destination'] = substr($this->fileOrFolderObject->getCombinedIdentifier(), 0, -strlen($this->fileOrFolderObject->getName()));
+            $assigns['destination'] = $this->fileOrFolderObject->getParentFolder()->getCombinedIdentifier();
         }
 
         $assigns['fileName'] = $this->fileOrFolderObject->getName();