[TASK] Use array_replace_recursive to merge columnsOverrides 74/52074/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 17 Mar 2017 09:58:27 +0000 (10:58 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 17 Mar 2017 13:15:10 +0000 (14:15 +0100)
commit07bd3e31516cd53ba65ff61ebd8b9c37336b6244
tree5a3dfb8f1524f7af9f8ef6b155f339f1753a30d7
parent33102bd197960c8732fa0004d26b01eab0b10636
[TASK] Use array_replace_recursive to merge columnsOverrides

Merging columnsOverrides into columns in FormEngine data provider
TcaColumnsOverrides is done via ArrayUtility::mergeRecursiveWithOverrule()
which supports the '__UNSET' feature to kick array parts from the
original array.
This is problematic since TCA should be additive only, for instance
the 'isloaded' display condition has been removed for that reason, too.
Specific issue is here that using __UNSET stops working if there is
a second mergeRecursiveWithOverrule() later, for instance in the
element expansion classes. This leads to hard to track issues and
almost always does not end up with a result a developer expects.
Solution is switching to php built-in array_replace_recursive() instead
which does not do __UNSET magic.
In general, always only add things to the columns array in columnsOverrides,
columns should have the common dominator of all overrides. Disabling of
specific features can be done only by adding a new key 'disableFoo' = true
or similar, the according TCA feature has to explicitely support that.

Change-Id: Ieba262c899ae2df2e3aa2c63d7dfa6b86e3fa4f4
Resolves: #80321
Releases: master
Reviewed-on: https://review.typo3.org/52074
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaColumnsOverrides.php