Bug #42333
closedFlexform displayCondition
0%
Description
I just wanted to configure my flexform file with conditions.
The field should be displayed depending from a field from another tab.. that didn't work
I've already found this issue:
http://forge.typo3.org/issues/33390
In the t3lib/class.t3lib_tceforms.php on line 2530 is everything ok.
That is just how it should work.
But in the function "isDisplayCondition" it is still wrong.
if ($ffValueKey) { if (strpos($parts[1], 'parentRec.') !== FALSE) { $fParts = explode('.', $parts[1]); $theFieldValue = $row['parentRec'][$fParts[1]]; } else { $theFieldValue = $row[$parts[1]][$ffValueKey]; } } else { $theFieldValue = $row[$parts[1]]; }
Here it still checks if the string "parentRec" is in the condition String.
It doesn't provide different tabs in conditions.
I've tried this in my flexform
<displayCond>FIELD:sDEF.switchableControllerActions:=:List->new</displayCond>
Its in another Tab than "sDEF".
I think its a bug.
But if i just made an mistake in the usage.. please correct me
Updated by Alexander Stehlik almost 11 years ago
It can be a bug or a missing feature, but it currently you can only access the field values of fields in the same sheet for field display conditions.
The values of other fields are only accessible in the sheet display conditions.
Updated by Wouter Wolters almost 10 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
Hi,
does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?
Updated by Alexander Stehlik almost 10 years ago
I can confirm that this problem still exists in the current master.
The problem is, that the \TYPO3\CMS\Backend\Form\Element\FlexElement->getSingleField_typeFlex_draw()
method only knows the values of the current sheet.
This is why conditions can only match values in their own sheet.
Updated by Alexander Opitz over 9 years ago
- Status changed from Needs Feedback to New
Updated by Eric Chavaillaz over 9 years ago
I can confirm this with TYPO3 7.3.1...
Thanks!
Updated by Alexander Stehlik about 9 years ago
I'm afraid the original problem is not fixed.
This is working: you can use fields from other tabs within display conditions for whole tabs, I use the felogin FlexForm as an example here:
<s_redirect> <ROOT> <TCEforms> <displayCond><![CDATA[FIELD:sDEF.showPermaLogin:REQ:TRUE]]></displayCond> <sheetTitle>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.sheet_redirect</sheetTitle> </TCEforms> <type>array</type> ... </ROOT> </s_redirect>
What is not working is using the value of a field from another tab in a field display condition.
This will work (because the field is from the same tab):
<showForgotPassword> <TCEforms> <displayCond><![CDATA[FIELD:showPermaLogin:REQ:TRUE]]></displayCond> <label>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.show_forgot_password</label> ... </TCEforms> </showForgotPassword>
This will not work (neither with sDEF.showPermaLogin
nor with showPermaLogin
):
<redirectMode> <TCEforms> <displayCond><![CDATA[FIELD:showPermaLogin:REQ:TRUE]]></displayCond> <label>LLL:EXT:felogin/locallang_db.xml:tt_content.pi_flexform.redirectMode</label> ... </TCEforms> </redirectMode>
The reason for this is that the ElementConditionMatcher
in the FlexFormElementContainer
only gets the data from the current sheet and does not know anything about the other sheets.
Updated by Claus Due about 9 years ago
- Category set to FormEngine aka TCEforms
Setting category to FormEngine like related issue #64323 - like that issue, please forgive if the category is incorrect.
I suspect this is caused by some (clearly not all!) code locations assuming a default sheet name or the displayCond logic itself somehow is unable to either detect the current sheet name and/or access values of fields in foreign sheet names. But I can't back this up with a source code location and don't currently have time to read the thousands of lines of changed code in the FormEngine.
Updated by Morton Jonuschat about 9 years ago
- Status changed from New to Rejected
We discussed this in view of the recent FormEngine rewrite and decided that accessing fields from other sheets within FlexForm display conditions will not be supported.
Having access to all sheets and fields using the sheetName.fieldName syntax on the sheet level and to the fields within the current sheet on field level is the desired behavior.
If you think that closing this issue is the wrong decision please write to the mailing list typo3.teams.bugs with the issue number and an explanation or open a new ticket and add a relation to this ticket number.