Skip to content
Snippets Groups Projects
Commit aded73b1 authored by Torben Hansen's avatar Torben Hansen Committed by Stefan Bürk
Browse files

[BUGFIX] Prevent undefined array key exception in FlexFormValueFormatter

The `getProcessedElements` function in `FlexFormValueFormatter`
throws an undefined array key exception, when the given
dataStructure contains a field with a relation table having a
`label_userFunc` and when the given valueStructure does not contain
a value for the field.

This change adds a fallback to an empty string, when
`$valueStructure[$elementKey]['vDEF']` is not set.

Resolves: #104760
Releases: main, 12.4
Change-Id: I133028b341d6df10a32f56858f8be8cfe951625a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85808


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 93187a72
Branches
Tags
No related merge requests found
......@@ -196,8 +196,8 @@ class FlexFormValueFormatter
if ($relationTable !== null && $labelUserFunction !== null) {
$parameters = [
'table' => $relationTable,
'row' => BackendUtility::getRecord($relationTable, $valueStructure[$elementKey]['vDEF']),
'title' => $valueStructure[$elementKey]['vDEF'],
'row' => BackendUtility::getRecord($relationTable, $valueStructure[$elementKey]['vDEF'] ?? ''),
'title' => $valueStructure[$elementKey]['vDEF'] ?? '',
];
GeneralUtility::callUserFunction($labelUserFunction, $parameters);
$processedValue = $parameters['title'];
......
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