In some cases (I found this on panel nodes specifically) the code in path_redirect_init() ends up initializing the theme, which ends up breaking themekey and stopping it from being able to switch theme properly. I found this out using the deg snippet that is discussed in the issue liked to below (see this comment http://drupal.org/node/754970#comment-4966192 for a snippet that actually works). This shows that just after path_redirect_init is run, the theme is initialized to the default theme. Commenting out path_redirect_goto() in path_redirect_init fixes the issue and gets themekey going again, but obviously breaks path_redirect.

See #754970: Skipped rule checking because another module already initialized the theme engine for more details.

After shoving a load of debug statements in the code of path_redirect_goto(), I found that the problem actually lies in this snippet of code:

    if (url($redirect['redirect']) == url($_GET['q'])) {
      // Prevent infinite loop redirection.
      watchdog('path_redirect', 'Redirect to <code>%redirect

is causing an infinite loop; redirect cancelled.', array('%redirect' => $redirect['redirect_url']), WATCHDOG_WARNING, l(t('Edit'), 'admin/build/path-redirect/edit/'. $redirect['rid']));
}

Commenting out that watchdog statement solves the problem. I find it hard to see how a call to watchdog would cause this, but there you go. We are using the core syslog module as opposed to dblog, if that makes any difference!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrfelton’s picture

Status: Active » Needs review
FileSize
1 KB

Heres a patch for our drush make files - it just comments out the watchdog call. You may want to handle that another way, or get to the root of the watchdog issue!

mkalkbrenner’s picture

Status: Needs review » Active

watchdog() uses t() to translate the message. t() uses a theme function for replacing variables like %redirect. That initializes the theme engine.