a-r-m-i-n / dce

TYPO3 CMS Extension. Best FlexForm based content elements since 2012. With TCA mapping feature, simple backend view and much more features which makes it super easy to create own content element types.
12 stars 19 forks source link

<displayCond> before <config> causes TCA migration Exception in combination with dce_skip_translation #125

Open a-r-m-i-n opened 4 days ago

a-r-m-i-n commented 4 days ago

When you add a display condition to the flexform configuration of a DCE field and put it in front of the <config> node, DCE will generate invalid XML, when dce_skip_translation is set.

When the option dce_skip_translation is set, the method OutputTcaAndFlexForm::applyDisplayCondForSkipTranslation will merge the existing display conditions with additional conditions for sys_language_uid and l18n_parent.

This merge does not work correctly, when the <displayCond> node is located before the <config> node.

TYPO3 v12 will output the following error, when adding a new DCE content element with this configuration. TYPO3 v13 will always throw an exception with this error, after clearing caches:

Missing "type" in TCA of field "['dummyTable']['dummyField']['config']".


Quickfix until this bug is resolved: Move the <displayCond> node behind the <config> node.

a-r-m-i-n commented 4 days ago

Also, because of the check $existingDisplayCond->childNodes->item(0) instanceof \DOMText, merged display conditions fail, when you add spaces and line-breaks inside the condition. For example:

<displayCond>
    <OR>
        <numIndex index="0">FIELD:parentRec.colPos:=:0</numIndex>
        <numIndex index="1">FIELD:parentRec.colPos:=:110</numIndex>
    </OR>
</displayCond>

This check must be rewritten entirely.