Project

General

Profile

Actions

Bug #79657

closed

Flexform: Ajax tree loading crashes on display condition

Added by Thorben Nissen almost 8 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
Start date:
2017-02-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #91190: Flex form: displayCond on a field references a field or field / sheet combination that is not found in data valuesRejected2020-04-25

Actions
Has duplicate TYPO3 Core - Bug #80163: Flexform displaycond with switchableControllerActions sys_category tree not workingClosed2017-03-07

Actions
Actions #1

Updated by Georg Ringer almost 8 years ago

yes please push a change, that would be great!

Actions #2

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

Actions #3

Updated by Christian Kuhn almost 8 years ago

  • Target version changed from 8.6 to 8 LTS
  • Sprint Focus set to Stabilization Sprint
Actions #4

Updated by Helmut Hummel almost 8 years ago

  • Status changed from Under Review to Needs Feedback

@Thorben: can you post an example setup to reproduce this?

Actions #5

Updated by Mads Lønne Jensen almost 8 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

Actions #6

Updated by Gerrit Code Review almost 8 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

Actions #7

Updated by Gerrit Code Review almost 8 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

Actions #8

Updated by Gerrit Code Review almost 8 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

Actions #9

Updated by Gerrit Code Review almost 8 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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

Updated by Christian Kuhn over 7 years ago

added a test scenario to styleguide: elements_select -> in flex -> selectTree, select_tree_2

Actions #14

Updated by Thorben Nissen over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions #16

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
Actions

Also available in: Atom PDF