Bug #36720

Settings from package cannot override default value with empty array

Added by Christopher Hlubek over 3 years ago. Updated over 2 years ago.

Status:Resolved Start date:2012-04-30
Priority:Must have Due date:
Assigned To:Christopher Hlubek % Done:

100%

Category:-
Target version:-
PHP Version: Complexity:
Has patch:No Affected Flow version:Git master

Description

A more specific setting file cannot override a list of values (array) with an empty array. The method arrayMergeRecursiveOverrule is not consistent in its logic, since setting NULL will also override the default, so this should also work with an empty array if emptyValuesOverride is TRUE.

We need that fix to override security firewall filters in functional tests. Besides that the current behaviour is not intuitive when treating NULL and empty arrays differently and limits extensibility.

A fix for this - while logically correct - causes problems when loading policies, such that roles from different packages or contexts override each other where they should be additive in behaviour.

Associated revisions

Revision abdffa83
Added by Christopher Hlubek over 2 years ago

[!!!][BUGFIX] Enable settings override with empty array value

This change updates the behavior of arrayMergeRecursiveOverrule such
that empty arrays are also treated as empty values. If you used this
function before it can lead to different results after the change.

Before the change an empty array value was always merged
into the first array, even if emptyValuesOverride was set to TRUE.
With the new behavior an empty array value overrides a given input
value if emptyValuesOverride is set. This allows to override settings
with an empty array in the settings hierarchy.

This change is breaking if your settings hierarchy depends on
empty array values not overriding a parent configuration.

Resolves: #36720
Releases: master, 2.0
Change-Id: Ib7b93e62b59cea4c3d706eb39a66e01f2c44a22e

Revision 339f877c
Added by Christopher Hlubek over 2 years ago

[!!!][BUGFIX] Enable settings override with empty array value

This change updates the behavior of arrayMergeRecursiveOverrule such
that empty arrays are also treated as empty values. If you used this
function before it can lead to different results after the change.

Before the change an empty array value was always merged
into the first array, even if emptyValuesOverride was set to TRUE.
With the new behavior an empty array value overrides a given input
value if emptyValuesOverride is set. This allows to override settings
with an empty array in the settings hierarchy.

This change is breaking if your settings hierarchy depends on
empty array values not overriding a parent configuration.

Resolves: #36720
Releases: master, 2.0
Change-Id: Ib7b93e62b59cea4c3d706eb39a66e01f2c44a22e

History

#1 Updated by Gerrit Code Review over 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#2 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#3 Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#4 Updated by Gerrit Code Review about 3 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#5 Updated by Gerrit Code Review about 3 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#6 Updated by Gerrit Code Review almost 3 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10896

#7 Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10896

#8 Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10896

#9 Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/10896

#10 Updated by Christopher Hlubek over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#11 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19568

#12 Updated by Christopher Hlubek over 2 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF