diff --git a/composer.json b/composer.json index 4b08496..3823c0f 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "drupal/search_api": "^1.21", "drush/drush": ">=10", "localgovdrupal/localgov_alert_banner": "^1.2.0", - "localgovdrupal/localgov_base": "^1.3.1", + "localgovdrupal/localgov_base": "^1.7.0", "localgovdrupal/localgov_core": "^2.12.0", "localgovdrupal/localgov_demo": "^3.0@alpha", "localgovdrupal/localgov_directories": "^3.0", diff --git a/localgov.info.yml b/localgov.info.yml index 09af78b..d801c9c 100644 --- a/localgov.info.yml +++ b/localgov.info.yml @@ -56,6 +56,7 @@ install: - localgov_services:localgov_services_navigation - localgov_services:localgov_services_page - localgov_services:localgov_services_sublanding + - localgov_base:localgov_base_helper dependencies: - localgov_core:localgov_core diff --git a/localgov.install b/localgov.install index e74ff19..fe8a6d7 100644 --- a/localgov.install +++ b/localgov.install @@ -101,3 +101,18 @@ function localgov_update_9503() { } } } + +/** + * Update existing sites to enable the theme dependency module for base. + */ +function localgov_update_9504() { + // The theme dependency should have caused the module to exist, but lets not + // fail if it's not there, as this is just a helper. The theme will continue + // to work when updated later, but report the requirement. + if (\Drupal::service('theme_handler')->themeExists('localgov_base')) { + if (\Drupal::service('module_installer')->install(['localgov_base_helper'])) { + return t('Base theme helper module enabled.'); + } + return t('LocalGov Base theme will require the LocalGov Base Helper module. Enable it manually when upgrading to version 1.7.0 or higher.'); + } +}