[BUGFIX] Subfolders must use the identifier as identifier 98/19198/3
authorGeorg Ringer <georg.ringer@gmail.com>
Fri, 22 Mar 2013 18:14:45 +0000 (19:14 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 23 Mar 2013 18:34:08 +0000 (19:34 +0100)
Currently subfolders don't use the identifier correctly as the name is
used instead. This doesn't really matter if you got a folder structure
anyway but dealing with different identifiers leads to troubles.

createFolderObject() will create a new Folder object which then has the
identifier set wrong.

Change-Id: I04629ffc97766557abc0920f1dbe56f1453d76ac
Fixes: #46568
Releases: 6.1,6.0
Reviewed-on: https://review.typo3.org/19198
Reviewed-by: Tom Ruether
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/core/Classes/Resource/Folder.php

index b4e4b02..0a3a037 100644 (file)
@@ -253,11 +253,8 @@ class Folder implements FolderInterface {
                if (count($folderArray) > 0) {
                        /** @var $factory ResourceFactory */
                        $factory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
-                       // TODO this will not work with non-hierarchical storages
-                       // -> the identifier for subfolders is not composed of the
-                       // current item's identifier for these
                        foreach ($folderArray as $folder) {
-                               $folderObjects[$folder['name']] = $factory->createFolderObject($this->storage, $this->identifier . $folder['name'] . '/', $folder['name']);
+                               $folderObjects[$folder['name']] = $factory->createFolderObject($this->storage, $folder['identifier'], $folder['name']);
                        }
                }
 
@@ -470,4 +467,4 @@ class Folder implements FolderInterface {
 }
 
 
-?>
\ No newline at end of file
+?>