Problem/Motivation
Currently Config::resetOverriddenData()
completely removes the overriddenData
class's property instead of reset the property value.
/**
* Resets the current data, so overrides are re-applied.
*
* This method should be called after the original data or the overridden data
* has been changed.
*
* @return \Drupal\Core\Config\Config
* The configuration object.
*/
protected function resetOverriddenData() {
unset($this->overriddenData);
return $this;
}
the instruction unset($this->overriddenData);
remove the class's property when the correct behaviour should be set overriddenData
to NULL.
This is not a big deal in se but
1) it is not consistent (and IMHO this can be marked as a bug).
2) it can cause warning with code that use reflection (but this of course is not a strong point). Libs like Kint or Doctrine Debug are affected by this issue.
Proposed resolution
Make Config::resetOverriddenData()
behaves consistently and reset only the VALUE of the property, not remove the class's property itself
Remaining tasks
Issue Summary update
Answer questions in #8 and #16
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 2833979-2.patch | 457 bytes | willzyx |
Comments
Comment #2
willzyx CreditAttribution: willzyx commentedComment #4
dawehnerHa, nice and quick test. I'm curious whether this results in any change of the observable universe?
Comment #5
Chi CreditAttribution: Chi commentedSeems like not unique case.
$ ag 'unset\(\$this->[a-z]*\)'
Comment #8
borisson_Does #5 mean that we should fix this for the other occurances as well?
Comment #16
larowlanWhat's the impact here? Can we get that added to the issue summary
Feels minor at best
Comment #19
quietone CreditAttribution: quietone at PreviousNext commentedAdding tag for IS update.