Skip to content

Commit

Permalink
[BUGFIX] Prevent PHP Warning with TCA selectTree
Browse files Browse the repository at this point in the history
Make sure there is actually an 'items' array in the processedTCA
before validating the items.

Resolves: #88624
Releases: master, 9.5, 8.7
Change-Id: I1fb6d47ac017ce6950926387387ad19d8445af74
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61359
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
liayn authored and maddy2101 committed Aug 2, 2019
1 parent c32e8b7 commit 5d88e68
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -237,10 +237,13 @@ protected function getRecordTitleForSelectType($value, $fieldConfig)
return '';
}
$labelParts = [];
foreach ($value as $itemValue) {
$itemKey = array_search($itemValue, array_column($fieldConfig['items'], 1));
if ($itemKey !== false) {
$labelParts[] = $fieldConfig['items'][$itemKey][0];
if (!empty($fieldConfig['items'])) {
$listOfValues = array_column($fieldConfig['items'], 1);
foreach ($value as $itemValue) {
$itemKey = array_search($itemValue, $listOfValues);
if ($itemKey !== false) {
$labelParts[] = $fieldConfig['items'][$itemKey][0];
}
}
}
$title = implode(', ', $labelParts);
Expand Down

0 comments on commit 5d88e68

Please sign in to comment.