Bug #80473
closedDo not bypass fetch of database record if tableName is tt_content
100%
Description
In the case that one have a custom extension which has flexform and use section which will allow the user to select between possible arrays of objects to create in the form
How to reproduce:
1. Use e.g. (ext:news "composer require georgringer/news")
2. Inside flexform_news.xml in general settings part inside <el> add the code bellow
<testElement> <section>1</section> <type>array</type> <el> <record> <type>array</type> <el> <question> <TCEforms> <label>Question</label> <config> <type>input</type> </config> </TCEforms> </question> <answer1> <TCEforms> <label>Answer 1</label> <config> <type>input</type> </config> </TCEforms> </answer1> <answer2> <TCEforms> <label>Answer 2</label> <config> <type>input</type> </config> </TCEforms> </answer2> <answer3> <TCEforms> <label>Answer 3</label> <config> <type>input</type> </config> </TCEforms> </answer3> <correctanswer> <TCEforms> <label>Correct Answer</label> <config> <type>radio</type> <items type="array"> <numIndex index="0" type="array"> <numIndex index="0">1</numIndex> <numIndex index="1">1</numIndex> </numIndex> <numIndex index="1" type="array"> <numIndex index="0">X</numIndex> <numIndex index="1">2</numIndex> </numIndex> <numIndex index="2" type="array"> <numIndex index="0">2</numIndex> <numIndex index="1">3</numIndex> </numIndex> </items> <default>1</default> </config> </TCEforms> </correctanswer> </el> </record> </el> </testElement>
3. In a specific page under "plugin settings" you have a button with the data added in flexform_news.xml "<testElement>...</testElement>"
Result: Don't show the specific options added in flexform when you click the button.
Expected result: Show the specific options added in flexform when you click the button.
This specific XML structure (the so-called "FlexForm") is stored in the pi_flexform "tt_content" database table which then provides additional form fields in the backend.
With the latest changes on #80100 this will fail because will bypass the fetch of database record if already loaded.
The suggested change is to check if the tableName is not "tt_content" and not bypass the fetch of database record.
Files