Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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/55487 Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Tobi Kretschmann <tobi@tobishome.de> 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: Frank Naegler <frank.naegler@typo3.org> Tested-by: Frank Naegler <frank.naegler@typo3.org> Reviewed-by: Peter Kraume <peter.kraume@gmx.de> Tested-by: Peter Kraume <peter.kraume@gmx.de> Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: Oliver Hader <oliver.hader@typo3.org>
- Loading branch information
1 parent
308242e
commit 7789987
Showing
5 changed files
with
164 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...xt/form/Tests/Unit/Mvc/Configuration/Fixtures/OverruleNonArrayValuesOverArrayValues1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Form: | ||
klaus01: | ||
key01: value1 | ||
key02: value2 | ||
key03: value2 |
2 changes: 2 additions & 0 deletions
2
...xt/form/Tests/Unit/Mvc/Configuration/Fixtures/OverruleNonArrayValuesOverArrayValues2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Form: | ||
klaus01: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters