Bug #91236

Numeric array keys are not merged correctly in YAML import

Added by Jan Delius 9 months ago. Updated 5 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-04-29
Due date:
% Done:

0%

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

Description

If in a YAML file another one is included by imports, numeric array keys are reset, if they are already described elsewhere in the current file or another import.

This functionality is important for the Form Framework to be able to split its own finishers into several YAML files. There is a way around this in ext:form (simply do not import the values separately, but define them centered somewhere else), but this does not allow a clean separation.

Example:
If you want to insert a value into file A.yaml under TYPO3.CMS.Form.prototypes.standard.formElementsDefinition.Form.formEditor.editors.900.selectOptions, this works without any problems. If you now add another value to file B.yaml, the values do not appear at the end under 900.selectOptions, but under 0.selectOptions and 1.selectOptions.

This only happens when one or both of these files are imported into a YAML file. If the files are loaded independently via TypoScript, it works without problems.

Example A.yaml:

TYPO3:
  CMS:
    Form:
      test:
        20:
          a: b

Example B.yaml:

TYPO3:
  CMS:
    Form:
      test:
        20:
          e: f
        21:
          c: d

My FormSetup.yaml:

imports:
  - { resource: "./A.yaml" }
  - { resource: "./B.yaml" }

This results in the following result:

TYPO3:
  CMS:
    Form:
      test:
        0:
          e: f
        1:
          c: d
        2:
          a: b

Which it should be:

TYPO3:
  CMS:
    Form:
      test:
        20:
          a: b
          e: f
        21:
          c: d

Also available in: Atom PDF