Bug #94039

Change of the tt_content plugin can lead to corrupted FlexForm

Added by Xavier Perseguers 7 months ago. Updated 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2021-05-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

One of my webmasters changed a EXT:news plugin to become a EXT:file_list plugin.

As usual, the former FlexForm is kept instead of being cleared and both FlexForm start being interleaved.

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
    <data>
        <sheet index="sDEF">
            <language index="lDEF">
                <field index="settings.mode">
                    <value index="vDEF">FOLDER</value>
                </field>
                <field index="settings.path">
                    <value index="vDEF"><![CDATA[t3://folder?storage=1&identifier=REMOVED]]></value>
                </field>
                <field index="settings.orderBy">
                    <value index="vDEF">NAME</value>
                </field>
                <field index="settings.sortDirection">
                    <value index="vDEF">ASC</value>
                </field>
                <field index="settings.includeSubfolders">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.orderDirection">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.dateField">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.categoryConjunction">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.categories">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.includeSubCategories">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.archiveRestriction">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.timeRestriction">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.timeRestrictionHigh">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.topNewsRestriction">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.singleNews">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.previewHiddenRecords">
                    <value index="vDEF">2</value>
                </field>
                <field index="settings.startingpoint">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.recursive">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.selectedList">
                    <value index="vDEF"></value>
                </field>
            </language>
        </sheet>
        <sheet index="display">
            <language index="lDEF">
                <field index="settings.newDuration">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.templateLayout">
                    <value index="vDEF">Simple</value>
                </field>
            </language>
        </sheet>
        <sheet index="additional">
            <language index="lDEF">
                <field index="settings.detailPid">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.listPid">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.backPid">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.limit">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.offset">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.tags">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.hidePagination">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.list.paginate.itemsPerPage">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.topNewsFirst">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.excludeAlreadyDisplayedNews">
                    <value index="vDEF">0</value>
                </field>
                <field index="settings.disableOverrideDemand">
                    <value index="vDEF">1</value>
                </field>
            </language>
        </sheet>
        <sheet index="template">
            <language index="lDEF">
                <field index="settings.media.maxWidth">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.media.maxHeight">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.cropMaxCharacters">
                    <value index="vDEF"></value>
                </field>
                <field index="settings.templateLayout">
                    <value index="vDEF"></value>
                </field>
            </language>
        </sheet>
    </data>
</T3FlexForms>

Problem is that EXT:file_list has settings.templateLayout as well, but not under the same "sheet", EXT:news has it under sheet "display" whereas EXT:file_list has it under sheet "template".

When my webmaster choose another template, the key from sheet "display" is updated, instead of the (correct) key under sheet "template". This leads to the key being empty and the EXT:file_list plugin just cannot be properly updated.


Related issues

Related to TYPO3 Core - Bug #73630: flexform data is not deleted when changing pluginAccepted2016-02-23

Actions
#1

Updated by Xavier Perseguers 7 months ago

  • Category changed from FormEngine aka TCEforms to Extbase

EDIT: actually, FlexForm is not wrong, but Extbase is wrong, it wrongly reads the whole configuration and overrides the (correct) display / settings.templateLayout with the (wrong from EXT:next) empty definition template / settings.templateLayout at the end

#2

Updated by Oliver Hader 7 months ago

Good point, so actually it's not "wrong" to keep old data persisted ("old" also means changing from A to B, and one minute late back from B to A). However retrieving components (like Extbase) should filter and limit to the currently valid schema when using that information.

#3

Updated by Riccardo De Contardi 7 months ago

  • Related to Bug #73630: flexform data is not deleted when changing plugin added

Also available in: Atom PDF