Bug #60339
closeddisplayCond for sheets in flexform with extbase settings namespace
100%
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...
Updated by Loon Buster about 10 years ago
Updated by Mathias Schreiber almost 10 years ago
Loon Buster wrote:
//list($sheetName, $fieldName) = GeneralUtility::trimExplode('.', $splitCondition1);
$tempArray = GeneralUtility::trimExplode('.', $splitCondition1);
$sheetName = $tempArray0;
array_shift($tempArray);
$fieldName = implode('.', $tempArray);
$fieldValue = $editData['data'][$sheetName][$lang][$fieldName];
$splitCondition1 = $fieldName;
$dataStruct['ROOT']['TCEforms']['displayCond'] = join(':', $splitCondition);
$fakeRow = array($fieldName => $fieldValue);
break;
Updated by Pascal Dürsteler almost 10 years ago
Is this really still an issue or is it just me? Because I have the same problem right now in 6.2.7. According to http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2014-June/014909.html it should work, but I can't manage to get it to work.
Updated by Pascal Dürsteler almost 10 years ago
Sorry, my fault. This works as intended. Can be closed.
Updated by Uwe Wiebach almost 10 years ago
Pascal Dürsteler wrote:
Sorry, my fault. This works as intended. Can be closed.
No, this is still an issue but your case (or at least the one you linked to) is different as it handles fields. Here it's about display conditions for sheets ...
LoonBusters solution works but it would be nice if we could also have multiple conditions (linked by AND or OR) - as it's possible with fields.
Updated by Gerrit Code Review about 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44370
Updated by Gerrit Code Review about 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44370
Updated by Morton Jonuschat about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 655b53531d42fb73559bfebdcecdbe7f695183e6.