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).

CommentFileSizeAuthor
#2 commentrss_594484.patch.patch4.04 KBfrjo

Comments

dave reid’s picture

Title: Calling drupal_add_feed in hook_init breaks SwitchTheme module » Calling drupal_add_feed in hook_init breaks theming
Version: 6.x-2.0 » 6.x-2.x-dev
frjo’s picture

Status: Active » Needs review
StatusFileSize
new4.04 KB

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.

BrockBoland’s picture

Status: Needs review » Reviewed & tested by the community

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.

jwilson3’s picture

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.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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