Posted by kcoop on October 2, 2009 at 7:26pm
| Project: | Comment RSS |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Calling drupal_add_feed indirectly calls theme_init, which performs the assignment of the $theme variable before switchtheme_init gets a change to update $custom_theme.
Apparently it is a no-no to do anything that initializes theming in hook_init (see here: http://drupal.org/node/219910).
Comments
#1
#2
This patch replace the hook_init() call with hook_nodeapi() and hook_theme_registry_alter().
This solves the $custom_theme problem and an added benefit is that the Custom RSS links in the header now comes *after* the core RSS links.
#3
Just came across this bug with the themes in Organic Groups. Patch worked for me, though it's worth noting for anyone else who tries it that it will fail against 6.x-2.2 and only works against head.
#4
I can second the RTBC here. This issue popped up for me on ThemeKey module #754970: Skipped rule checking because another module already initialized the theme engine and upping to HEAD and applying the patch in #2 fixed the issue.
#5
This has now been fixed with the following commits:
http://drupalcode.org/project/commentrss.git/commit/e25c49a
http://drupalcode.org/project/commentrss.git/commit/739a525
#6
Automatically closed -- issue fixed for 2 weeks with no activity.