[BUGFIX] Renaming files on non LocalDriver storages 75/56475/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 21 Jan 2018 17:37:49 +0000 (18:37 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Mar 2018 12:52:00 +0000 (14:52 +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/56475
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/File/RenameFileController.php

index 25c360f..05d53d2 100644 (file)
@@ -145,7 +145,7 @@ class RenameFileController extends AbstractModule
         } else {
             $fileIdentifier = $this->fileOrFolderObject->getUid();
             $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();