[META] Convert theme to service.

Created on 16 September 2019, about 5 years ago
Updated 1 March 2024, 9 months ago

At the moment when creating a new theme we do a process we call "clone and own" where you copy the Sector Starter base theme and develop from that new theme.

This means that if a bug is found in the starter theme all themes that have been 'cloned' off that theme will have the same bug and it won't be possible to fix it with an update hook or anything like that since it's code level.

The goal of this issue will be to turn the theme code to a service, so when you update Sector you get the latest theme code.

function sector_starter_form_system_theme_settings_alter(&$form, &$form_state) {
      // Vertical tab.
    $form['sector_starter'] = array(
      '#type' => 'vertical_tabs',
      '#prefix' => '<h2><small>Sector starter settings</small></h2>',
      '#weight' => -20,
    );
    // Component.
    $form['customizations'] = array(
      '#type' => 'details',
      '#title' => t('Inline SVG logo'),
      '#group' => 'sector_starter',
    );

    // Textarea for user to enter the svg_logo_source.
    $form['customizations']['svg_logo_source'] = array(
      '#type'     => 'textarea',
      '#title'    => t('Add your SVG logo raw source code here:'),
      '#description'    => t('Inline SVGs can be targeted via CSS e.g. to add hover effects. This setting overrides the default logo supplied by the theme via Global Settings below.'),
      '#format'   => 'full_html',
      '#required' => FALSE,
      '#default_value' => theme_get_setting('svg_logo_source'),
    );
  }
}

becomes

function sector_starter_form_system_theme_settings_alter(&$form, &$form_state) {
  Drupal::service('sector_utils.theme_helpers')->systemThemeSettingsAlter($form, $form_state);
}
🐛 Bug report
Status

Closed: outdated

Version

9.2

Component

Code

Created by

🇳🇿New Zealand danielveza Brisbane, AU

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024