Issue Bug Closed

#60339displayCond for sheets in flexform with extbase settings namespace

M. Ecker 07/15/14, 15:43 updated 10/02/18, 11:52

Description

To be available in Extbase controllers via $this->settings array, flexform fields have to be named as

<settings.xyz> </settings.xyz>

If you want to use such a field as displayCond for another sheet, you’ll get a problem:

<displayCond>FIELD:sDEF.settings.xyz:!=:0</displayCond>

will always be true, since the getSingleField_typeFlex() method of TYPO3\CMS\Backend\Form\FormEngine will drop the ‘xyz’ part (LINE 2820 ff.) and deliver FIELD:settings as displayCond to the isDisplayCondition() method.

                            case 'FIELD':
                                list($sheetName, $fieldName) = GeneralUtility::trimExplode('.', $splittedCondition[1]);
                                $fieldValue = $editData['data'][$sheetName][$lang][$fieldName];
                                $splittedCondition[1] = $fieldName;
                                $dataStruct['ROOT']['TCEforms']['displayCond'] = join(':', $splittedCondition);
                                $fakeRow = array($fieldName => $fieldValue);
                                break;

That’s only a problem if you want to use the xyz setting not only as displayCond, but also within your controller – but in my current extension I have to do this…

Reviews 1