Skip to content

Commit

Permalink
Merge pull request #1580 from acquia/ACMS-update-hook
Browse files Browse the repository at this point in the history
ACMS-000: An update hook added to update the config_ignore.settings file.
  • Loading branch information
vishalkhode1 authored Jun 22, 2023
2 parents 7380e60 + 6b45a74 commit 94ba297
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions modules/acquia_cms_common/acquia_cms_common.install
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,26 @@ function acquia_cms_common_update_8007() {
\Drupal::service('module_installer')->uninstall(['purge_processor_lateruntime']);
}
}

/**
* Implements hook_update_N().
*
* Update config_ignore configuration.
*/
function acquia_cms_common_update_8008() {
$config = \Drupal::configFactory()->getEditable('config_ignore.settings');
if ($config) {
$existing_ignore_configs = $config->get('ignored_config_entities');
$updated_ignored_configs = $existing_ignore_configs;
$key = array_search("cohesion.settings", $updated_ignored_configs);
if ($key !== FALSE) {
unset($updated_ignored_configs[$key]);
}
$updated_ignored_configs[] = "cohesion_*";
$updated_ignored_configs = array_values(array_unique($updated_ignored_configs));
if ($existing_ignore_configs != $updated_ignored_configs) {
$config->set('ignored_config_entities', $updated_ignored_configs)
->save(TRUE);
}
}
}

0 comments on commit 94ba297

Please sign in to comment.