diff --git a/composer.json b/composer.json index f5d92fb..e5d51a8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "localgovdrupal/localgov_directories": "^3.1", "localgovdrupal/localgov_events": "^3.0", "localgovdrupal/localgov_microsites_group": "^4.0", - "localgovdrupal/localgov_microsites_base": "^2.0", + "localgovdrupal/localgov_microsites_base": "^2.0.3", "localgovdrupal/localgov_microsites_colour_picker_fields": "^1.0.0-beta1", "localgovdrupal/localgov_news": "^2.3", "localgovdrupal/localgov_page": "^1.0.0-beta2", diff --git a/localgov_microsites.info.yml b/localgov_microsites.info.yml index abc3ee3..8e888e1 100644 --- a/localgov_microsites.info.yml +++ b/localgov_microsites.info.yml @@ -62,6 +62,7 @@ install: - localgov_microsites_group:localgov_microsites_group_webform - localgov_paragraphs:localgov_paragraphs_views - localgov_sa11y:localgov_sa11y + - localgov_base:localgov_base_helper themes: - localgov_microsites_base diff --git a/localgov_microsites.install b/localgov_microsites.install index 4869f77..f29c2ad 100644 --- a/localgov_microsites.install +++ b/localgov_microsites.install @@ -56,3 +56,18 @@ function localgov_microsites_update_10001() { $role->save(); } } + +/** + * Update existing sites to enable the theme dependency module for base. + */ +function localgov_microsites_update_10002() { + // 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. Required by LocalGov Microsites Base 2.0.3'); + } +}