Actions
Bug #98630
closedPHP Warning: Undefined array key foobar in typo3_src-11.5.17/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php line 1394
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2022-10-17
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
PHP Warning: Undefined array key foobar in typo3_src-11.5.17/typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php line 1394
public function pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF')
{
$sheetArray = is_array($T3FlexForm_array) ? $T3FlexForm_array['data'][$sheet][$lang] : '';
The warning occures when the stored flexform data doesn't contain a flexform sheet ($sheet) that has been added to a flexform but the record is outdated.
Solution could be?
public function pi_getFFvalue($T3FlexForm_array, $fieldName, $sheet = 'sDEF', $lang = 'lDEF', $value = 'vDEF')
{
if (isset($T3FlexForm_array['data'][$sheet])){
$sheetArray = is_array($T3FlexForm_array) ? $T3FlexForm_array['data'][$sheet][$lang] : '';
if (is_array($sheetArray)) {
return $this->pi_getFFvalueFromSheetArray($sheetArray, explode('/', $fieldName), $value);
}
}
return null;
}
Actions