[BUGFIX] Fix folder selection in ElementBrowser 60/35760/2
authorMarkus Klein <klein.t3@reelworx.at>
Mon, 8 Dec 2014 01:25:13 +0000 (02:25 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 3 Jan 2015 16:54:32 +0000 (17:54 +0100)
Resolves: #63651
Releases: master, 6.2
Change-Id: Ica4b9dab922be15bffd67f1dbd90ea8e4522838d
Reviewed-on: http://review.typo3.org/35760
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php

index 77a844d..ddd0abb 100644 (file)
@@ -1522,10 +1522,12 @@ class ElementBrowser {
                $folderTree->ext_noTempRecyclerDirs = $this->mode == 'filedrag';
                $tree = $folderTree->getBrowsableTree(FALSE);
                list(, , $specUid) = explode('_', $this->PM);
-               if ($this->mode == 'filedrag') {
-                       $folders = $this->TBE_dragNDrop($this->selectedFolder, $parameters[3]);
-               } else {
-                       $folders = $this->TBE_expandSubFolders($this->selectedFolder);
+               if ($this->selectedFolder) {
+                       if ($this->mode == 'filedrag') {
+                               $folders = $this->TBE_dragNDrop($this->selectedFolder, $parameters[3]);
+                       } else {
+                               $folders = $this->TBE_expandSubFolders($this->selectedFolder);
+                       }
                }
                // Putting the parts together, side by side:
                $content .= '
@@ -2018,13 +2020,14 @@ class ElementBrowser {
                $folderIcon = $aTag;
                $folderIcon .= '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/i/_icon_webfolders.gif',
                                'width="18" height="16"') . ' alt="" />';
-               $folderIcon .= htmlspecialchars(GeneralUtility::fixed_lgd_cs(basename($baseFolder), $titleLength));
+               $folderIcon .= htmlspecialchars(GeneralUtility::fixed_lgd_cs($baseFolder->getName(), $titleLength));
                $folderIcon .= '</a>';
                $content .= $folderIcon . '<br />';
 
                $lines = array();
                // Traverse the folder list:
-               foreach ($folders as $folderPath) {
+               foreach ($folders as $subFolder) {
+                       $folderPath = $subFolder->getPublicUrl();
                        $pathInfo = pathinfo($folderPath);
                        // Create folder icon:
                        $icon = '<img src="clear.gif" width="16" height="16" alt="" /><img'
@@ -2051,7 +2054,7 @@ class ElementBrowser {
                        $aTag_e = '</a>';
                        // Combine icon and folderpath:
                        $foldernameAndIcon = $aTag_alt . $icon
-                               . htmlspecialchars(GeneralUtility::fixed_lgd_cs(basename($folderPath), $titleLength)) . $aTag_e;
+                               . htmlspecialchars(GeneralUtility::fixed_lgd_cs($subFolder->getName(), $titleLength)) . $aTag_e;
                        if ($this->P['itemName'] != '') {
                                $lines[] = '
                                        <tr class="bgColor4">