[FOLLOWUP][TASK] Fluidification of Opendocs Toolbar (2nd try) 12/50512/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 5 Nov 2016 18:07:57 +0000 (19:07 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 5 Nov 2016 18:51:12 +0000 (19:51 +0100)
`list($x, )` does not work on empty arrays, causing `$x` being null then.
The code now checks whether there are actually open docs and then does
the list() stuff.

Resolves: #78051
Releases: master
Change-Id: I73d2c3ca40bea8c3dce2ac1de0ec97e136bf228b
Reviewed-on: https://review.typo3.org/50512
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php

index 0bdac3b..1e2a217 100644 (file)
@@ -63,7 +63,10 @@ class OpendocsToolbarItem implements ToolbarItemInterface
     public function loadDocsFromUserSession()
     {
         $backendUser = $this->getBackendUser();
-        list($this->openDocs, ) = $backendUser->getModuleData('FormEngine', 'ses') ?: [];
+        $openDocs = $backendUser->getModuleData('FormEngine', 'ses');
+        if ($openDocs !== null) {
+            list($this->openDocs, ) = $openDocs;
+        }
         $this->recentDocs = $backendUser->getModuleData('opendocs::recent') ?: [];
     }