[BUGFIX] Prevent PHP notice in TreeController 19/57019/3
authorFrank Naegler <frank.naegler@typo3.org>
Tue, 22 May 2018 07:22:52 +0000 (09:22 +0200)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Tue, 22 May 2018 10:23:49 +0000 (12:23 +0200)
With #81987 we have introduced code, which could cause PHP notices.
This patch changes the check to prevent such notices.

Resolves: #85057
Related: #81987
Releases: master
Change-Id: I85e85501c2593b8abacac1d8296148d03d57f407
Reviewed-on: https://review.typo3.org/57019
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/backend/Classes/Controller/Page/TreeController.php

index 6b0762c..f95eb9f 100644 (file)
@@ -356,7 +356,7 @@ class TreeController
                 $entryPointRootLine = $pageRepository->getRootLine($entryPoint);
                 foreach ($entryPointRootLine as $rootLineEntry) {
                     $parentUid = $rootLineEntry['uid'];
-                    if ($this->backgroundColors[$parentUid] !== null && $this->backgroundColors[$entryPoint] === null) {
+                    if (!empty($this->backgroundColors[$parentUid]) && empty($this->backgroundColors[$entryPoint])) {
                         $this->backgroundColors[$entryPoint] = $this->backgroundColors[$parentUid];
                     }
                 }