On the blocks configuration page (admin/build/block) menu items are created for all themes in the Drupal installation. Since it's unlikely that blocks will need to be configured for disabled themes, we should remove these items altogether when the theme is not enabled. The theme system already uses this approach for the various settings pages for themes (admin/build/themes/settings), so it seems like it's only logical to do the same for blocks.

Currently in system.module:

  foreach (list_themes() as $theme) {
    if ($theme->status) {
      $items['admin/build/themes/settings/'. $theme->name] = array(
        'title' => $theme->info['name'],
        'page arguments' => array('system_theme_settings', $theme->name),
        'type' => MENU_LOCAL_TASK,
      );
    }
  }

Currently in block.module:

  $default = variable_get('theme_default', 'garland');
  foreach (list_themes() as $key => $theme) {
    $items['admin/build/block/list/'. $key] = array(
      'title' => '!key settings',
      'title arguments' => array('!key' => $theme->info['name']),
      'page arguments' => array('block_admin_display', $key),
      'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
      'weight' => $key == $default ? -10 : 0,
    );
  }

Comments

profix898’s picture

Thats exactly like it was a few months ago. The problem is that you need to configure disabled themes in certain situations. For example, without this option you are not able to configure blocks for your admin theme ... We were thinking about a better way to only show themes in blocks configuration that are used by core or some module (og, category, taxonomy_theme, ...). I cant remember the exact issue atm.

quicksketch’s picture

I guess this request never made it into an official release. I can't remember this being the case. Would allowing the administration to also be configured be preferable? It's terrifying to a client to click on a different theme on the blocks page and be warped into a different theme.

quicksketch’s picture

StatusFileSize
new1.33 KB

A patch that allows the admin theme blocks to be configured also.

profix898’s picture

Status: Needs review » Closed (duplicate)

see http://drupal.org/node/103717
Only showing the enabled and admin themes is not sufficient. In that case contrib 'theme switching' modules (such as og, category, taxonomy_theme) would be facing the same problem as in 4.7. What means themes used by these modules were not configurable. If you have such a module installed core's admin theme is no longer a special case. Please note Jaza's approach that looks really promising IMO.

quicksketch’s picture

Thanks profix898 for digging that up for me :)