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
Updated by Gerrit Code Review over 7 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/52174
Updated by Xavier Perseguers over 7 years ago
- File editrow.png editrow.png added
- File zone.png zone.png added
- Status changed from Under Review to Accepted
- Priority changed from Should have to Must have
- Target version set to next-patchlevel
A few more info regarding this bug. I could reproduce with the suggested FlexForm.
This is how it looks like:
When clicking the "+" icon, the AJAX call goes into our change with a databaseRow
actually already containing some useless info since it wouldn't fail if it were empty since only the vanillaUid
column is useful in this method.
Stack trace:
I don't really like the suggested fix, I'd prefer to check why only the "uid" is populated in the first place and see whether we could just omit this partial initialisation instead.
Updated by Xavier Perseguers over 7 years ago
The database row is initialized from \TYPO3\CMS\Backend\Controller\FormFlexAjaxController::containerAdd
at line 74.
Updated by Gerrit Code Review over 7 years ago
- Status changed from Accepted 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/52174
Updated by Faton Haliti over 7 years ago
- Target version changed from next-patchlevel to 8 LTS
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/52174
Updated by Xavier Perseguers over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ff0b0832e2cee479f540d9287a671e178278f2f6.
Updated by Daniel Goerz over 7 years ago
- Related to Bug #80825: FlexForm Sections don't get saved before the parent record was stored to the DB added
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed