Issue Bug Closed

#67620Illegal string offset 'switchableControllerActions' in /typo3/sysext/backend/Classes/Form/DataPreprocessor.php line 575

Bernd Niehues 06/19/15, 09:27 updated 10/02/18, 11:44

Description

When trying to edit a backend content element (plugin) which includes a flexform file the above error is thrown.
renderRecord_flexProc_procInData has a $sheetDef-Array with lDEF-Key and a l(ISO2)-Key for each configured language.
For me it looks like that:

lDEF -> switchableControllerActions …
lDE -> ‘‘
lES -> ‘‘
lFR -> ‘’

It iterates through the array and calls renderRecord_flexProc_procInData_travDS for each element.
In line 575 it trys to check if $dataValues[$key] is an array, which it is in case of lDEF.
But in case of lDE there is no $dataValues[$key] and so the error is thrown

So my solution would be (and is solving the problem in my case): Change line 575 from

if (is_array($dsConf['TCEforms']['config']) && is_array($dataValues[$key])) {

to

if (is_array($dsConf['TCEforms']['config']) && isset($dataValues[$key]) && is_array($dataValues[$key])) {

in /typo3/sysext/backend/Classes/Form/DataPreprocessor.php

Reviews 2