Commit ab524689 authored by crell's avatar crell Committed by Stefan Bürk
Browse files

[BUGFIX] Provide a default value in TemplateService to avoid null values

Resolves: #97744
Releases: main
Change-Id: I60f3424696f2b6b655922b6c377ce65ec139c877
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74829

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 32f7784c
...@@ -1340,11 +1340,6 @@ parameters: ...@@ -1340,11 +1340,6 @@ parameters:
count: 1 count: 1
path: ../../typo3/sysext/core/Classes/Type/Enumeration.php path: ../../typo3/sysext/core/Classes/Type/Enumeration.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
- -
message: "#^Method TYPO3\\\\CMS\\\\Core\\\\TypoScript\\\\TemplateService\\:\\:getRootlineLevel\\(\\) should return int but returns false\\.$#" message: "#^Method TYPO3\\\\CMS\\\\Core\\\\TypoScript\\\\TemplateService\\:\\:getRootlineLevel\\(\\) should return int but returns false\\.$#"
count: 1 count: 1
......
...@@ -722,6 +722,6 @@ class ExtendedTemplateService extends TemplateService ...@@ -722,6 +722,6 @@ class ExtendedTemplateService extends TemplateService
*/ */
public function getRootLine(): array public function getRootLine(): array
{ {
return is_array($this->absoluteRootLine) ? $this->absoluteRootLine : []; return $this->absoluteRootLine;
} }
} }
...@@ -164,10 +164,8 @@ class TemplateService ...@@ -164,10 +164,8 @@ class TemplateService
/** /**
* Rootline all the way to the root. Set but runThroughTemplates * Rootline all the way to the root. Set but runThroughTemplates
*
* @var array
*/ */
protected $absoluteRootLine; protected array $absoluteRootLine = [];
/** /**
* Array of arrays with title/uid of templates in hierarchy * Array of arrays with title/uid of templates in hierarchy
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment