FlexForm does not substitute markers in foreign_table_where
We tried to use a field-to-select condition in a flexform.
We have a FlexForm containing two Select-Fields:
1. StoragePid (Selecting from Pages-Table)
2. Any foreign record (like tt_address) that should show all records matching the FlexForm "StoragePid".
As FlexForm simply consists of XML'ified TCA we thought we can use ###REC_FIELD_StoragePid### (whereas "
StoragePid" is the XML-Name of our Storage Selector form pages).
We noticed that the markers are not working correctly by reading/substituting those values from FlexForm XML.
#2 Updated by Gabriel Kaufmann / Typoworx NewMedia almost 7 years ago
Well I didn't find the right entry-point for a Core-Patch yet.
##REC_FIELD_[ ROW-FIELD ]is substituted within
- The parsing of different Field-Types for TCA is done in
- Setting a "Dummy" Field within
t3lib_flexformtools::traverseFlexFormXMLData(f.e.) doesn't work as t3lib_befunc is accessing the row using
Anyone having ideas how to solve this?
Of course I could also use an ItemProcFunc on EACH PROJECT I ever need this. But I really think there should be one place to solve this problem and this would be the Core to have a one-place solution that is working for all.
#3 Updated by Gabriel Kaufmann / Typoworx NewMedia almost 7 years ago
Since this issue/feature seems to be more complicated than I expected, I have to fall-back to itemProcFunc in FlexForm.
I believe we have to patch
as there the REC_FIELD's are substituted.
Too bad - there is no "row" argument used f.e.
$TSconfig['_THIS_ROW'] build somewhere else.
- Check if the current-field renderes is inside FlexForm (refer to
- Map all FlexForm-Values (of course we should respect lDEF and a possible localisation!) to the DB-Row temporarely (for Flex-Field rendering only).
- May be t3 t3lib-Rendering needs a complete clean-up to have one Storage for the current row?
Any ideas or suggestions are welcome!
#4 Updated by Gabriel Kaufmann / Typoworx NewMedia almost 7 years ago
I have worked-out a patch that is fixing the missing fields for the "###REC_FIELD_" markers.
For this I patched "t3lib_tceforms" (see patch file provided).
I would be glad for approval and submitting to Trunk. The patch has been created on TYPO3 4.7.12.
About the patch:
I had to set a class-variable around the flex-rendering to let sub-processess (also used by normal TCE rendering) that it is currently acting within FlexForm-Fields.
All "Flex" fields (marked as type "flex" in TCA) are processed now.
The current patch provides the following syntax:
###REC_FIELD_[ flex-fieldname ].[ flexform-field ]###
f.e. to access a field from TemplaVoila FlexForm field named "field_storagePid":
The original field is prepended to avoid conflicts between multiple database-fields that may have the same name!
I would be glad about any feedback here.