You are here

function social_core_update_8009 in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/social_core.install \social_core_update_8009()
  2. 8 modules/social_features/social_core/social_core.install \social_core_update_8009()
  3. 8.2 modules/social_features/social_core/social_core.install \social_core_update_8009()
  4. 8.3 modules/social_features/social_core/social_core.install \social_core_update_8009()
  5. 8.4 modules/social_features/social_core/social_core.install \social_core_update_8009()
  6. 8.5 modules/social_features/social_core/social_core.install \social_core_update_8009()
  7. 8.6 modules/social_features/social_core/social_core.install \social_core_update_8009()
  8. 8.7 modules/social_features/social_core/social_core.install \social_core_update_8009()
  9. 8.8 modules/social_features/social_core/social_core.install \social_core_update_8009()
  10. 10.3.x modules/social_features/social_core/social_core.install \social_core_update_8009()
  11. 10.0.x modules/social_features/social_core/social_core.install \social_core_update_8009()
  12. 10.1.x modules/social_features/social_core/social_core.install \social_core_update_8009()

Enable socialblue theme and make default if socialbase is current default.

File

modules/social_features/social_core/social_core.install, line 501
Install, update and uninstall functions for the social_core module.

Code

function social_core_update_8009() {
  $system_theme_settings = \Drupal::configFactory()
    ->get('system.theme')
    ->get('default');
  if ($system_theme_settings === 'socialbase') {
    $themes = [
      'socialblue',
    ];
    \Drupal::service('theme_handler')
      ->install($themes);
    \Drupal::configFactory()
      ->getEditable('system.theme')
      ->set('default', 'socialblue')
      ->save();

    // Ensure that the install profile's theme is used.
    // @see _drupal_maintenance_theme()
    \Drupal::service('theme.manager')
      ->resetActiveTheme();
    \Drupal::messenger()
      ->addStatus(t('Installed socialblue theme and made this the default. Please check release notes.'));
  }
  else {
    \Drupal::messenger()
      ->addStatus(t('Skipped installing socialblue theme. Please check release notes.'));
  }
}