Bug #85710

tx_form: Multiple Extensions with YAML additionalViewModel overwrite configuration array

Added by David Bascom over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Form Framework
Target version:
-
Start date:
2018-08-01
Due date:
% Done:

100%

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

Description

We have an Typo3 8.7.17 installation with two custom extensions.

Both extensions extend the tx_form with a custom formelement and add a JS-module using the additionalViewModelModules in YAML.
Only the additionalViewModelModules array of the last extension is respected and loads the JS-modules from ...Resources/Public/JavaScript/Backend/FormEditor/...
This results in an empty backend-preview for the formelement of the first extension.

The FormEditorSetup.yaml of the first extension:

TYPO3:
  CMS:
    Form:
      prototypes:
        standard:
          formEditor:
            dynamicRequireJsModules:
              additionalViewModelModules:
                - 'TYPO3/CMS/Nnscouts/Backend/FormEditor/NnscoutsViewmodel'

The FormEditorSetup.yaml of the second extension:

TYPO3:
  CMS:
    Form:
      prototypes:
        standard:
          formEditor:
            dynamicRequireJsModules:
              additionalViewModelModules:
                - 'TYPO3/CMS/Dsgvo/Backend/FormEditor/DsgvoViewModel'

Reason seems to be that the merge of the arrays from additionalViewModelModules fails: Actually it is not merged, but the array of ext2 replaces the array of ext1 – or in other words: by the extension that was loaded last.

We made sure, that both YAML-configurations are loaded correctly and the JS-files are at the right place.
Removing the dynamicRequireJsModules-section from the second extension and adding a additional item to the array of the first extension – and vice versa – works:

TYPO3:
  CMS:
    Form:
      prototypes:
        standard:
          formEditor:
            dynamicRequireJsModules:
              additionalViewModelModules:
                - 'TYPO3/CMS/Dsgvo/Backend/FormEditor/DsgvoViewModel'
                - 'TYPO3/CMS/Nnscouts/Backend/FormEditor/NnscoutsViewmodel'

Also available in: Atom PDF