[BUGFIX] Uncaught exception if editor has no file mount 57/25357/3
authorMarkus Klein <klein.t3@mfc-linz.at>
Wed, 13 Nov 2013 01:19:43 +0000 (02:19 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 18 Dec 2013 14:19:09 +0000 (15:19 +0100)
If an editor has got no file mounts, an uncaught exception
is shown in the element browser.

Fix this by checking if there is a selected folder at all.

Resolves: #52969
Releases: 6.2
Change-Id: I5f9e8cc7994edd69f6db6ae1cc647ee31e4930c6
Reviewed-on: https://review.typo3.org/25357
Reviewed-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php

index 711e639..ebab560 100644 (file)
@@ -1235,10 +1235,14 @@ class ElementBrowser {
                $foldertree->ext_noTempRecyclerDirs = $this->mode == 'filedrag';
                $tree = $foldertree->getBrowsableTree();
                list(, , $specUid) = explode('_', $this->PM);
-               if ($this->mode == 'filedrag') {
-                       $files = $this->TBE_dragNDrop($this->selectedFolder, $pArr[3]);
+               if ($this->selectedFolder) {
+                       if ($this->mode == 'filedrag') {
+                               $files = $this->TBE_dragNDrop($this->selectedFolder, $pArr[3]);
+                       } else {
+                               $files = $this->TBE_expandFolder($this->selectedFolder, $pArr[3], $noThumbs);
+                       }
                } else {
-                       $files = $this->TBE_expandFolder($this->selectedFolder, $pArr[3], $noThumbs);
+                       $files = '';
                }
                // Putting the parts together, side by side:
                $content .= '
@@ -2249,4 +2253,4 @@ class ElementBrowser {
                return $result;
        }
 
-}
\ No newline at end of file
+}