domain_theme does not respect any non-existing theme settings and just rewrites global $conf settings with empty value instead of just skipping the override.

Use case:
Omega 4 theme stores theme settings in .info file. If domain_theme module is enabled, any theme settings overrides in code are rewritten by NULL.

Solution
in domain_theme_set_variables() change

  if (!empty($theme['settings'])) {
    $settings = domain_unserialize($theme['settings']);

to

if (!empty($theme['settings']) && $settings = domain_unserialize($theme['settings']) && !empty($settings)) {

CommentFileSizeAuthor
#1 domain-null-settings-2219977-1.patch698 bytesalex.skrypnyk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alex.skrypnyk’s picture

Patch for above code

agentrickard’s picture

Status: Active » Needs work

Wouldn't this be better?

if (!empty($theme['settings']) && $settings = domain_unserialize($theme['settings'])) {
  $conf['theme_' . $theme['theme'] . '_settings'] += $settings;
...

The problem is not that $settings is empty, it's that it resets the entire $conf array element. Your patch doesn't fix that behavior.