Skip to content

Commit

Permalink
UHF-8955: reconfigure simple_sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Sep 27, 2023
1 parent 2630e82 commit bb97369
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions modules/helfi_base_content/helfi_base_content.install
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,24 @@ function helfi_base_content_update_9004() : void {
$config_factory->getEditable('block.block.brandingnavigation')->delete();
$config_factory->getEditable('block.block.hdbt_subtheme_brandingnavigation')->delete();
}

/**
* UHF-8955 simple_sitemap - do not process menu_link_content entities.
*/
function helfi_base_content_update_9005() : void {
$config_factory = Drupal::configFactory();

// Remove menu_link_content from enabled entity types:
$config = $config_factory->getEditable('simple_sitemap.settings');
if (!$config->isNew()) {
$enabled_entity_types = $config->get('enabled_entity_types');
$enabled_entity_types = array_values(array_filter($enabled_entity_types, static fn ($item) => $item !== 'menu_link_content'));
$config->set('enabled_entity_types', $enabled_entity_types);
$config->save();
}

// Remove remaining menu_link_content related settings.
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.main')->delete();
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.branding-navigation')->delete();
$config_factory->getEditable('simple_sitemap.bundle_settings.default.menu_link_content.account')->delete();
}

0 comments on commit bb97369

Please sign in to comment.