Closed (duplicate)
Project:
ThemeKey
Version:
6.x-1.0
Component:
Code / API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2009 at 23:03 UTC
Updated:
4 Dec 2011 at 09:23 UTC
I'm not sure entirely why, but I was having themekey not work on nodes (node:type), where it did work fine on taxonomy:vid.
After doing some diging and dpming around, I discovered that for the taxonomy:vid, the hook_init was getting called early, and so the global $theme variable was null, so init_theme() would work fine. But for nodes, apparently init_theme() has already run once, so the global $theme was set!
I changed it to work by adding the following to the end of themekey_init():
$custom_theme = $theme;
// Need to clear the global theme for init_theme to do anything.
global $theme;
$theme = NULL;
init_theme();Which caused it to work fine. Ideas? It's a bit of a hack, but otherwise this module looks to do exactly what I need to do.
Comments
Comment #1
jcfiala commentedAfter looking on some of the other posts, I removed the change I made, and instead set the weight of themekey in the system table to -2. This fixed the problem I was having.
Comment #2
profix898 commentedOn install the default weight of the module is now set to -10 ...
Comment #4
TimeBandit commentedUpon upgrading to 3.6 I had this same issue. Checked database and system > themekey was set to 0. I set it to -10 and it resolved the issue.
Comment #5
math-hew commented#4 solved this issue for me as well.
Comment #6
mkalkbrennersee #754970: Skipped rule checking because another module already initialized the theme engine