Enabled all themes in admin/build/themes (default is Garland)
Tried to set domain theme for admin/build/domain/theme/1
Problem: radio button reverts back to Garland when saving.

On a side note: having read the following comment in Drupal themes setting,
I feel that "single theme, multiple colours" will be my choice, when/if available.

Note that different themes may have different regions available for rendering content like blocks.
If you want consistency in what your users see, you may wish to enable only one theme

CommentFileSizeAuthor
#6 domain_theme.patch718 bytesagentrickard

Comments

agentrickard’s picture

Category: support » bug

It works for me. Question:

When you go to assign a theme for alpha.example.com, does the URL change to:

alpha.example.com/admin/build/domain/theme/1

It should. In some cases we have to force you to be on the domain you wish to edit.

The fix is related to http://drupal.org/node/186153. So if you aren't being taken to
alpha.example.com/admin/build/domain/theme/1, then there is another bug.

I also assume that "when saving" means "after saving".

That aside, does the theme switch work on the home page(s)?

skizzo’s picture

Theme switching works only for the base Drupal installation ( admin/build/themes )
Trying to switch theme on domains, it does correctly land me on
alfa.example.com/admin/build/domain/theme/number
Then I pick a non-Garland theme and click on "Set domain theme".
Default reverts back to Garland, while URL remains the same.
Nothing is logged by watchdog. If I can help looking at the
db content please let me know.

skizzo’s picture

also tried to create a brand new test domain, to no avail.
The domain_theme table is, and stays, empty.

agentrickard’s picture

Strange. Try this:

Open domain_theme_form.inc. Edit this function:

function domain_theme_submit($form_id, $form_values) {
  // ADD THESE LINES
  watchdog('domain', 'Theme settings form invoked');
  drupal_set_message('Theme set');

  $theme = $form_values['theme_default'];
  $id = $form_values['domain_id'];
  $settings = NULL; // This is a placeholder for advanced functions.
  $check = domain_theme_lookup($id);
  if ($check == -1) {
    db_query("INSERT INTO {domain_theme} VALUES (%d, '%s', %b)", $id, $theme, $settings);
  }
  else {
    db_query("UPDATE {domain_theme} SET theme = '%s', settings = %b WHERE domain_id = %d", $theme, $settings, $id);
  }
} 

It sounds as though hook_form_alter() isn't firing correctly -- if it is, then this watchdog message should be logged. Do you have any other theme-based modules installed? (e.g. Taxonomy Theme)

See http://therickards.com/api/file/domain_theme/domain_theme_form.inc/Domain for the documentation.

skizzo’s picture

No way... I reinstalled from scratch and configured a single domain,
applied your patch and tried to switch theme.

The "theme settings form invoked" message got logged, but then
I checked the domain_theme table, and it was still empty.

I have a plain installation, nothing around fiddling with themes.
Within Domain: only Access, Configuration and Themes modules are enabled.

Well, I'll give it another try tomorrow... thanks!

agentrickard’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new718 bytes

There was a bug in domain_theme_lookup(). See attached patch.

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.