[BUGFIX] Allow creation of nested folders with same name 85/44485/2
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Mon, 2 Nov 2015 17:43:23 +0000 (18:43 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 2 Nov 2015 19:03:56 +0000 (20:03 +0100)
Due to a faulty check it was disallowed to create a folder
with the same name as the parent folder.

Resolves: #71253
Releases: master
Change-Id: Iecf1f17534958f10363538dc74612e9a52435a0d
Reviewed-on: https://review.typo3.org/44485
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index f459d32..f92765a 100644 (file)
@@ -2271,7 +2271,7 @@ class ResourceStorage implements ResourceStorageInterface
         if (!$this->checkFolderActionPermission('add', $parentFolder)) {
             throw new Exception\InsufficientFolderWritePermissionsException('You are not allowed to create directories in the folder "' . $parentFolder->getIdentifier() . '"', 1323059807);
         }
         if (!$this->checkFolderActionPermission('add', $parentFolder)) {
             throw new Exception\InsufficientFolderWritePermissionsException('You are not allowed to create directories in the folder "' . $parentFolder->getIdentifier() . '"', 1323059807);
         }
-        if ($this->driver->folderExists($folderName)) {
+        if ($this->driver->folderExistsInFolder($folderName, $parentFolder->getIdentifier())) {
             throw new Exception\ExistingTargetFolderException('Folder "' . $folderName . '" already exists.', 1423347324);
         }
 
             throw new Exception\ExistingTargetFolderException('Folder "' . $folderName . '" already exists.', 1423347324);
         }