My multisite is setup as follows:

example.com
site1.example.com
site2.example.com

Each site has a different public theme. I would like to set a common admin theme though for all sites. So, naturally I go to site configuration->administration theme and change. I confirm this works for example.com, the main site. I next go to domainlist->settings for site1.example.com and change the admin theme in the dropdown, but it doesn't seem to work. I confirmed the setting was stored in the database in the domain_conf table.

Any one see this issue?

Comments

jbizzay’s picture

Oh, and caching is turned off as well as I truncated all the cache tables in the db.

jbizzay’s picture

Status: Postponed (maintainer needs more info) » Needs review

I fixed my issue! Also, added the administration theme to create content nodes...

Here's my modified function from domain_theme.module:


function domain_theme_menu($may_cache) {
  $items = array();
  if (!$may_cache) {
    // Menu items for configuring themes.
    $items[] = array(
      'title' => t('Domain theme settings'),
      'path' => 'admin/build/domain/theme',
      'access' => user_access('administer domains'),
      'type' => MENU_CALLBACK,
      'callback' => 'domain_theme_page',
      'callback arguments' => array(arg(4))
    );
        /**
         * Added this if block
         */
        if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'edit'
                || arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'delete'
                || arg(0) == 'node' && arg(1) == 'add'
                || arg(0) == 'admin') {

                global $custom_theme;
                $custom_theme = variable_get('admin_theme', 0);
                drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
                return $items;
        }
    // Assign the theme selected, based on the active domain.
    global $_domain, $custom_theme;
    $default_theme = variable_get('theme_default', 'garland');
    $theme = domain_theme_lookup($_domain['domain_id']);
    // The above returns -1 on failure.
    if ($theme != -1) {
      $custom_theme = $theme['theme'];
    }
  }
  return $items;
}

agentrickard’s picture

Did you try re-weighting the Domain Theme module using the setting provided?

This issue is a known flaw in Drupal's implementation of $custom_theme for admin themes.

agentrickard’s picture

Status: Needs review » Closed (won't fix)

This is really a core issue. Supporting custom themes for individual pages is not my responsibility.

Glad the patch above works for you.

jastern’s picture

fyi i posted a drupal-6 version of this issue, here: #324373: Domain Theme settings - Subsites admin theme set, but won't take (D6.x), also with a helpful response/solution from agentrickard (thanks again, a.r.).

asd123asd5’s picture

For anyone who does decide to use the fix provided by jasonalank it's worth noting that this only applies to pages within /admin/. as far as changing user information it will still revert to your other theme. You can fix this by testing if the user is an admin. I did a bit of a dodgey and just tested the uid of the admin account (since we only have one)

replace -
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'edit'
|| arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'delete'
|| arg(0) == 'node' && arg(1) == 'add'
|| arg(0) == 'admin') {

with +
if ($GLOBALS['user']->uid == 1) {

Remember that this was with an older version, make sure you only apply the pieces you need.