Bug #79657
closedFlexform: Ajax tree loading crashes on display condition
Added by Thorben Nissen almost 8 years ago. Updated about 7 years ago.
100%
Description
When loading a tree view in a flexform for a field that has a display condition to another field, a strange js error occurs (in Firefox).
I found out, that is seems to be an exception thrown while evaluation the display condition.
This exception is normally thrown for a non existing field in the flexform to indicate a faulty display condition.
In this case the display condition is 100% correct. The cause of this missing fields seems to be the reduction of data in the FormSelectTreeAjaxController (lines 87 - 149). If this is removed, everything works fine.
I could issue a change request to the review system, if I should.
Updated by Georg Ringer almost 8 years ago
yes please push a change, that would be great!
Updated by Gerrit Code Review almost 8 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/51574
Updated by Christian Kuhn almost 8 years ago
- Target version changed from 8.6 to 8 LTS
- Sprint Focus set to Stabilization Sprint
Updated by Helmut Hummel over 7 years ago
- Status changed from Under Review to Needs Feedback
@Thorben: can you post an example setup to reproduce this?
Updated by Mads Lønne Jensen over 7 years ago
Okay, I figured out how to replicate the this issue:
Assume we have an plugin with some FlexForm added:
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY . '_pi1'] = 'pi_flexform'; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:myextension/Configuration/FlexForms/Test.xml');
This works as expected:
<?xml version="1.0" encoding="utf-8" ?> <T3DataStructure> <meta> <langDisable>1</langDisable> </meta> <sheets> <sDEF> <ROOT> <TCEforms> <sheetTitle>Sheet title</sheetTitle> </TCEforms> <type>array</type> <el> <show_other_field> <TCEforms> <label>Display stuff?</label> <config> <type>check</type> </config> </TCEforms> </show_other_field> <stuff> <TCEforms> <label>Stuff</label> <displayCond>FIELD:show_other_field:=:1</displayCond> <config> <type>check</type> </config> </TCEforms> </stuff> </el> </ROOT> </sDEF> </sheets> </T3DataStructure>
But this does not:
<?xml version="1.0" encoding="utf-8" ?> <T3DataStructure> <meta> <langDisable>1</langDisable> </meta> <sheets> <sDEF> <ROOT> <TCEforms> <sheetTitle>Sheet title</sheetTitle> </TCEforms> <type>array</type> <el> <show_other_field> <TCEforms> <label>Display stuff?</label> <config> <type>check</type> </config> </TCEforms> </show_other_field> <stuff> <TCEforms> <label>Stuff</label> <displayCond>FIELD:show_other_field:=:1</displayCond> <config> <type>select</type> <renderMode>tree</renderMode> <treeConfig> <parentField>pid</parentField> <appearance> <showHeader>TRUE</showHeader> <width>650</width> </appearance> </treeConfig> <internal_type>db</internal_type> <size>5</size> <autoSizeMax>20</autoSizeMax> <maxitems>1000</maxitems> <minitems>0</minitems> <foreign_table>sys_file_collection</foreign_table> <foreign_table_where>AND sys_file_collection.hidden = 0 AND (sys_file_collection.sys_language_uid = 0 OR sys_file_collection.l10n_parent = 0)</foreign_table_where> </config> </TCEforms> </stuff> </el> </ROOT> </sDEF> </sheets> </T3DataStructure>
The action FormSelectTreeAjaxController::fetchDataAction is called via ajax and return error 500:
Flex form displayCond on field "stuff" on flex form sheet "sDEF" references a field or field / sheet combination "show_other_field" that might be defined in given data structure but is not found in data values
Updated by Gerrit Code Review over 7 years ago
- Status changed from Needs Feedback to Under Review
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/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Gerrit Code Review over 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51574
Updated by Christian Kuhn over 7 years ago
added a test scenario to styleguide: elements_select -> in flex -> selectTree, select_tree_2
Updated by Thorben Nissen over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 36f1a701e887bf55e2470f646f5751974de2b0ef.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed
Updated by Georg Ringer over 4 years ago
- Related to Bug #91190: Flex form: displayCond on a field references a field or field / sheet combination that is not found in data values added