Bug #91293

FlexForm with inline field leads to console error "this.container is null"

Added by Alex Kellner over 1 year ago. Updated about 1 year ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-04
Due date:
% Done:

0%

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

Description

TYPO3 10.4.1

We have an own extension with a plugin and in this a FlexForm configuration where we can select some records.
Everything worked well with TYPO3 8.

Now, after updating, it's not possible to see an inline record by clicking the "+ Create New" button in FlexForm.
The browser console leads to
"this.container is null"

Example FlexForm Configuration how to reproduce:

<T3DataStructure>
    <meta>
        <langDisable>1</langDisable>
    </meta>
    <sheets>
        <main>
            <ROOT>
                <TCEforms>
                    <sheetTitle>Test</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <settings.ce>
                        <TCEforms>
                            <label>Test</label>
                            <config>
                                <type>inline</type>
                                <foreign_table>tt_content</foreign_table>
                                <foreign_field>t3ver_oid</foreign_field>
                                <foreign_sortby>sorting</foreign_sortby>
                                <foreign_label>header</foreign_label>
                                <maxitems>1</maxitems>
                            </config>
                        </TCEforms>
                    </settings.ce>
                </el>
            </ROOT>
        </main>
    </sheets>
</T3DataStructure>

Note: We do not use tt_content and not the field t3ver_oid for building relations. That is just the testcase for you.


Files

#1

Updated by Georg Ringer over 1 year ago

  • Status changed from New to Needs Feedback

can you retest on master, just added

 <settings.ce>
                        <TCEforms>
                            <label>Test</label>
                            <config>
                                <type>inline</type>
                                <foreign_table>tt_content</foreign_table>
                                <maxitems>1</maxitems>
                            </config>
                        </TCEforms>
                    </settings.ce>

to a flexform and it worked.

#2

Updated by Alex Kellner over 1 year ago

  • I retestet with master branch (dev-master in composer.json) in the project of the university - without success
  • I also removed all other third-party extensions and dismantled the function in the effected extension - without success
  • After this I went to my local powermail test instance, installed dev-master of TYPO3 and changed the EXT:powermail/Configuration/FlexForms/FlexformPi1.xml to this content:
<T3DataStructure>
    <meta>
        <langDisable>1</langDisable>
    </meta>
    <sheets>
        <main>
            <ROOT>
                <TCEforms>
                    <sheetTitle>Test</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <settings.ce>
                        <TCEforms>
                            <label>Test</label>
                            <config>
                                <type>inline</type>
                                <foreign_table>tt_content</foreign_table>
                                <maxitems>1</maxitems>
                            </config>
                        </TCEforms>
                    </settings.ce>
                </el>
            </ROOT>
        </main>
    </sheets>
</T3DataStructure>

Same failure (Firefox on Ubuntu) in browser console when opening the plugin: "TypeError: this.container is null" in "InlineControlContainer.js:13:2271"
Clicking on "+ Create new" does not work

After that I switched to Chrome (still on Ubuntu).
Error in Browserconsole is a bit different but with the same effect:

Uncaught TypeError: Cannot read property 'dataset' of null
    at HTMLDocument.<anonymous> (InlineControlContainer.js?bust=1588757745:13)
    at mightThrow (jquery.js?bust=1588757745:3557)
    at process (jquery.js?bust=1588757745:3625)

#3

Updated by Marco Dinnbier over 1 year ago

Hi,

the error is caused by the dot in variable name.

I think, this needs some escaping for calls like

this.container = document.querySelector("#" + e) in backend/Resources/Public/JavaScript/FormEngine/Container/InlineControlContainer.js

I've workarounded this in my project by renaming variables like settings.image to image.

Regards,
Marco

#4

Updated by Georg Ringer about 1 year ago

Hi Alex,

I just checked TYPO3 master and also again stable LTS 10.4.9 with latest powermail and it works for me on FF81 (mac). could you please recheck?

Also available in: Atom PDF