Commit d7f1c9ea authored by Markus Klein's avatar Markus Klein Committed by Anja Leichsenring
Browse files

[BUGFIX] Prevent PHP Warning with TCA selectTree

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/+/61122

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 9a110867
......@@ -234,10 +234,13 @@ class TcaRecordTitle implements FormDataProviderInterface
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);
......
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