[BUGFIX] EXT:form - fix array overrules within YAML preprocessing 65/55565/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Mon, 29 Jan 2018 13:56:45 +0000 (14:56 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 5 Feb 2018 18:27:19 +0000 (19:27 +0100)
commita509d71bd5da02cda3c3e9b812affed70792bf01
tree6f46526ad21dceff70dd3a15d2e6c7175772ff16
parent145439f808127142f60abbe357c406a5a40bcf5a
[BUGFIX] EXT:form - fix array overrules within YAML preprocessing

If you use the "__inheritance" operator within an EXT:form configuration
file, configuration keys of the parent element can be deleted in the
child element by giving the configuration key in the child element
the value NULL.
See https://docs.typo3.org/typo3cms/extensions/form/latest/Concepts/
Configuration/Index.html#inheritances for further information.

Before the "__inheritance" operators are executed, all configuration
files are merged using
TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule().

However, this does not work if you are using several configuration files.

Let's assume the configuration key in the previous configuration file is
an array. mergeRecursiveWithOverrule() does not delete this
configuration key, if the configuration key in the overriding
configuration file is not an array (for example: NULL). This is simply
ignored by mergeRecursiveWithOverrule().

This patch fixes this issue by adding a variation of
array_merge_recursive().

Resolves: #82051
Releases: master, 8.7
Change-Id: Id9d256226a3eb82f6bc3fd03904f944719e525e7
Reviewed-on: https://review.typo3.org/55565
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Peter Kraume <peter.kraume@gmx.de>
Tested-by: Peter Kraume <peter.kraume@gmx.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Classes/Mvc/Configuration/YamlSource.php
typo3/sysext/form/Documentation/Concepts/Configuration/Index.rst
typo3/sysext/form/Tests/Unit/Mvc/Configuration/Fixtures/OverruleNonArrayValuesOverArrayValues1.yaml [new file with mode: 0644]
typo3/sysext/form/Tests/Unit/Mvc/Configuration/Fixtures/OverruleNonArrayValuesOverArrayValues2.yaml [new file with mode: 0644]
typo3/sysext/form/Tests/Unit/Mvc/Configuration/YamlSourceTest.php