Story #69617: FormEngine bugs
Flexform displayCond not evaluated correctly when not in first sheet
I recently noticed some bug similiar to this one:
If i place displayCond as in the example below in the first sheet of a flexform it gets evaluated.
If i place it in the second sheet the field is not visible, even the condition is met.
Further displayConditions regarding the switchableControllerActions are not displayed on default values, so if the default value is set and it is valid for a displaycondition the field will not be displayed anyway - only on the initial creation of a new element.
If you save the new record with default values the condition is evaluated correctly.
This seems to be connected to:
TYPO3 Version is 7.6.1
[!!!][TASK] Improve flex and TCA handling in FormEngine
The patch adapts a series of nasty form engine areas to more solid
code. The evaluate condition code is rewritten and works much better
in flex form scenarios. The suggest wizard and svg tree are much
more solid in flex forms. The group element is rewritten
towards a better readable and easier to refactor code, dropping
method dbFileIcons(). A bunch of issues is resolved along the way.
- TCA "default" now works in flex form section container elements
- The "displayCond" parser is now strict and throws exceptions on
invalid syntax and wrong referenced fields to help debugging
faulty display conditions
- TCA displayCond on flex fields can now be prefixed with the
sheet name and can reference field values from neighbor sheets
- TCA displayCond now works with flex section containers
- TCA flex section container now throw an exception if select or
group fields configure a MM relation - this is not supported
- TCA ctrl requestUpdate field is dropped, onChange=reload is now allowed
not only on flex form fields, but also on normal columns fields
- TCA tree now works as section container element and initializes
correctly on new records and new containers
- GroupElement rewrite to drop dbFileIcons()
- config option maxitems now optional for type=group and type=select
and defaults to "many items allowed"
- inline now works in "fancy" flex situations with "new" records
by handing the final dataStructureIdentifier around
- FormEngine no longer loads extJS
Tested-by: TYPO3com <firstname.lastname@example.org>
Reviewed-by: Benni Mack <email@example.com>
Tested-by: Benni Mack <firstname.lastname@example.org>
Reviewed-by: Anja Leichsenring <email@example.com>
Tested-by: Anja Leichsenring <firstname.lastname@example.org>
#1 Updated by Morton Jonuschat over 3 years ago
- Category changed from DataHandler aka TCEmain to FormEngine aka TCEforms
- Status changed from New to Needs Feedback
- Target version deleted (
afaik this is the intended behavior. DisplayCond in FlexForm has two "levels". If you use a displayCond to decide wether a whole sheet should be shown/hidden then you have access to the values of all sheets using FIELD:sheetName.fieldName, if you use displayCond on on a field you only have access to the fields on that sheet (plus the database fields with parentRec.fieldName). Your example tries to access the field "switchableControllerActions" from one sheet within another sheet, which is why it's not working.
Did this work before? If so could you point me to the version of TYPO3?
#3 Updated by Philipp Wrann over 3 years ago
Cant get it working...
Same sheet (sDEF) displaycond: <displayCond><![CDATA[FIELD:sDEF.switchableControllerActions:=:Document->list]]></displayCond> does NOT work
Same sheet (sDEF) displaycond: <displayCond><![CDATA[FIELD:switchableControllerActions:=:Document->list]]></displayCond> does work
Other sheet: <displayCond><![CDATA[FIELD:sDEF.switchableControllerActions:=:Document->list]]></displayCond> does NOT work
Other sheet: <displayCond><![CDATA[FIELD:switchableControllerActions:=:Document->list]]></displayCond> does NOT work
Also displayConditions are NOT evaluated correctly with default values.
So is this a bug or am i still wrong?