Problem/Motivation
When default configuration is installed, changes are made that minimally include (a) adding a uuid value and (b) setting a hash of the default config to a _core key.
A full replacement of the target configuration item can be triggered by adding a special key-value pair, config_rewrite = 'replace', to an item added to config/replace. However, there is no code as yet to retain the keys added on original configuration install.
Proposed resolution
In _config_rewrite_rewrite_config(), within the if clause, copy over the relevant values:
foreach (['_core', 'uuid'] as $key) {
if (isset($original_config[$key])) {
$rewrite[$key] = $original_config[$key];
}
}
Alternately, introduce a dependency on Configuration Update Base (config_update) from the Configuration Update Manager project and use the ConfigReverter::revert() method. See #2829506: Simple config doesn't retain config hash when reverted. However, the ::revert() method wouldn't be directly applicable, as we can't feed in the replacement data.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2829512_10.patch | 2.04 KB | saltednut |
Comments
Comment #2
nedjoPostponed pending #2829511: Write tests for rewrites and refactoring in #2841961: Pull rewrite code into a service.
Comment #3
nedjoComment #4
saltednutComment #5
saltednutFirst pass at a patch. I guess we also need to come up with a test case for this.
Comment #6
saltednutComment #8
saltednutAnother pass at this based on the test failure.
Comment #10
saltednutAnother attempt.
Comment #11
saltednut