Project

General

Profile

Actions

Bug #72414

closed

FrontendConfigurationManager::overrideStoragePidIfStartingPointIsSet() ignores empty String response from getTreeList()

Added by Jan Starke over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
Start date:
2015-12-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

getTreeList() normally returns a comma separated List of PIDs, but it may also return an empty String (if no corresponding pages are found). In such a case, FrontendConfigurationManager::overrideStoragePidIfStartingPointIsSet() simply appends that empty string to $list (line 125 in FrontendConfigurationManager.php).

Some lines below, this empty String is imploded and appended to $pages, which in my case creates an array with the content "47,". The comma after 47 is the result of
$pages = $pages . ',' . implode(',', $list);
with $list being an empty String

I suggest the following fix:

123                 $explodedPages = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $pages);
124                 foreach ($explodedPages as $pid) {
125                     $pidList = $this->contentObject->getTreeList($pid, $this->contentObject->data['recursive']);
126                     if ($pidList) {
127                       array_push($list, $pidList);
128                     }
129                 }
130             }
131             if (!empty($list)) {
132                 $pages = $pages . ',' . implode(',', $list);
133             }

Kind regards, Jan

Actions

Also available in: Atom PDF