Commit ef218070 authored by Jochen Roth's avatar Jochen Roth Committed by Benni Mack
Browse files

[BUGFIX] Add fallback values for array keys in FormEngine

Array key undefined has been fixed by adding a fallback
value for array fields "doSaveFieldName" and
"elementBaseName"

Resolves: #94480
Releases: master
Change-Id: I89d315924136b527147f1b31fd0d7940719fcc6b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69716


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 16c5cae9
......@@ -93,7 +93,7 @@ class SingleFieldContainer extends AbstractContainer
$parameterArray['fieldConf']['config'] = FormEngineUtility::overrideFieldConf($parameterArray['fieldConf']['config'], $parameterArray['fieldTSConfig']);
$parameterArray['itemFormElName'] = 'data[' . $table . '][' . $row['uid'] . '][' . $fieldName . ']';
$parameterArray['itemFormElID'] = 'data_' . $table . '_' . $row['uid'] . '_' . $fieldName;
$newElementBaseName = $this->data['elementBaseName'] . '[' . $table . '][' . $row['uid'] . '][' . $fieldName . ']';
$newElementBaseName = isset($this->data['elementBaseName']) ? $this->data['elementBaseName'] . '[' . $table . '][' . $row['uid'] . '][' . $fieldName . ']' : '';
// The value to show in the form field.
$parameterArray['itemFormElValue'] = $row[$fieldName];
......
......@@ -89,7 +89,7 @@ class FormResultCompiler
*/
public function mergeResult(array $resultArray)
{
$this->doSaveFieldName = $resultArray['doSaveFieldName'];
$this->doSaveFieldName = $resultArray['doSaveFieldName'] ?? '';
foreach ($resultArray['additionalJavaScriptPost'] as $element) {
$this->additionalJavaScriptPost[] = $element;
}
......
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