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

CommentFileSizeAuthor
#10 2829512_10.patch2.04 KBsaltednut
#8 2829512_8.patch754 bytessaltednut
#5 2829512_5.patch668 bytessaltednut

Comments

nedjo created an issue. See original summary.

nedjo’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
Status: Active » Postponed
nedjo’s picture

Issue summary: View changes
saltednut’s picture

Status: Postponed » Active
saltednut’s picture

StatusFileSize
new668 bytes

First pass at a patch. I guess we also need to come up with a test case for this.

saltednut’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: 2829512_5.patch, failed testing.

saltednut’s picture

Status: Needs work » Needs review
StatusFileSize
new754 bytes

Another pass at this based on the test failure.

Status: Needs review » Needs work

The last submitted patch, 8: 2829512_8.patch, failed testing.

saltednut’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB

Another attempt.

saltednut’s picture

Status: Needs review » Fixed

  • brantwynn committed 826a0fc on 8.x-1.x
    Issue #2829512 by brantwynn: Retain uuid and _core keys when replacing...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.