[BUGFIX] Fix Fatal Error when trying to add a record on pid 0 64/43964/3
authorroman.schuermann <roman.schuermann@wmdb.de>
Sat, 10 Oct 2015 13:00:26 +0000 (15:00 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 10 Oct 2015 13:41:04 +0000 (15:41 +0200)
Releases: master
Resolves: #70566
Change-Id: Ic16afce4f99b9dc2d2db30b697b0ccf789bf3be2
Reviewed-on: http://review.typo3.org/43964
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Controller/NewRecordController.php

index 2b5f2db..d1d4e93 100644 (file)
@@ -240,8 +240,13 @@ class NewRecordController extends AbstractModule
     public function main()
     {
         // If there was a page - or if the user is admin (admins has access to the root) we proceed:
-        if ($this->pageinfo['uid'] || $this->getBackendUserAuthentication()->isAdmin()) {
-            $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
+        if (!empty($this->pageinfo['uid']) || $this->getBackendUserAuthentication()->isAdmin()) {
+            if (empty($this->pageinfo)) {
+                // Explicitly pass an empty array to the docHeader
+                $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation([]);
+            } else {
+                $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
+            }
             // Acquiring TSconfig for this module/current page:
             $this->web_list_modTSconfig = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod.web_list');
             $this->allowedNewTables = GeneralUtility::trimExplode(