From 153d404fa3114aa21f4b661bb98e67bcddca51b2 Mon Sep 17 00:00:00 2001 From: Mark Conroy Date: Wed, 25 Jun 2025 12:20:22 +0200 Subject: [PATCH 1/3] Add config for simple sitemap --- localgov_subsites.install | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/localgov_subsites.install b/localgov_subsites.install index b631054..a7f0450 100644 --- a/localgov_subsites.install +++ b/localgov_subsites.install @@ -16,6 +16,21 @@ function localgov_subsites_install($is_syncing) { if (\Drupal::moduleHandler()->moduleExists('localgov_services_navigation')) { localgov_subsites_optional_fields_settings(); } + + // Install default config for simple_sitemap, as this does not appear to work + // in the config/optional folder. + // Discussed on https://www.drupal.org/project/simple_sitemap/issues/3156080 + if (\Drupal::moduleHandler()->moduleExists('simple_sitemap')) { + $generator = \Drupal::service('simple_sitemap.entity_manager'); + $generator->setBundleSettings('node', 'localgov_subsites_overview', [ + 'index' => TRUE, + 'priority' => 1.0, + ]); + $generator->setBundleSettings('node', 'localgov_subsites_page', [ + 'index' => TRUE, + 'priority' => 0.5, + ]); + } } /** From af41f5aa14fccb5e5d67d98f093b209b50293b0b Mon Sep 17 00:00:00 2001 From: Mark Conroy Date: Wed, 25 Jun 2025 12:30:26 +0200 Subject: [PATCH 2/3] Update integer to string, or else 1.0 does not work --- localgov_subsites.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localgov_subsites.install b/localgov_subsites.install index a7f0450..f233423 100644 --- a/localgov_subsites.install +++ b/localgov_subsites.install @@ -24,11 +24,11 @@ function localgov_subsites_install($is_syncing) { $generator = \Drupal::service('simple_sitemap.entity_manager'); $generator->setBundleSettings('node', 'localgov_subsites_overview', [ 'index' => TRUE, - 'priority' => 1.0, + 'priority' => '1.0', // Cast as string to ensure the value is properly set ]); $generator->setBundleSettings('node', 'localgov_subsites_page', [ 'index' => TRUE, - 'priority' => 0.5, + 'priority' => '0.5', ]); } } From 7b874b12a106afb7336dafa536c70ad8a298691c Mon Sep 17 00:00:00 2001 From: Mark Conroy Date: Sun, 20 Jul 2025 13:47:09 +0100 Subject: [PATCH 3/3] Coding standards --- localgov_subsites.install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localgov_subsites.install b/localgov_subsites.install index f233423..3dca531 100644 --- a/localgov_subsites.install +++ b/localgov_subsites.install @@ -24,7 +24,8 @@ function localgov_subsites_install($is_syncing) { $generator = \Drupal::service('simple_sitemap.entity_manager'); $generator->setBundleSettings('node', 'localgov_subsites_overview', [ 'index' => TRUE, - 'priority' => '1.0', // Cast as string to ensure the value is properly set + // Cast as string to ensure the value is properly set. + 'priority' => '1.0', ]); $generator->setBundleSettings('node', 'localgov_subsites_page', [ 'index' => TRUE,