After installing the 2.x version of service links, the Blog Theme module stopped working on my site (blog theme allows each user to select a different theme for his blog entries): now, only the site's default theme is shown. I did not have any problems running service links 1.x together with blog theme.

I can get blog_theme working by disabling service links for "blog" content types; but I would like to have both together, as before. It seems like Service Links 2.x is somehow setting the theme when it is executed, rather than just placing the links at the bottom as it used to. Any ideas how to fix this?

CommentFileSizeAuthor
#4 blogtheme.patch761 bytesTheCrow

Comments

TheCrow’s picture

Status: Active » Postponed (maintainer needs more info)

A trouble like this was raised for a similar module: http://drupal.org/node/761332#comment-3663410
maybe it help you.

Edit:
I made some change and seem that service links hide... need study this more, sorry.

rene_w’s picture

For the record, I tried out the change in the comment you linked (since I also use Global Redirect), but that did not change anything, unfortunately.

TheCrow’s picture

seem that there is a problem when executing the nodeapi - load but service links doesnt change the theme, really weird...

[Edit:]
Changing in service_links_nodeapi()
the row:

case 'load':

with:

case 'prepare':

seem work for links but break the services in node

TheCrow’s picture

Status: Postponed (maintainer needs more info) » Fixed
Issue tags: +blogtheme
StatusFileSize
new761 bytes

I think i found the solution!

The trouble is due to the call of node_load() function inside the hook_init().
When a module use the theme() function in the nodeapi()->load operation the default theme become the default render theme for the node.
Thus every module shouldn't call the theme() function into the load operation otherwise changes made from blogtheme are nulls, either, blogtheme should avoid to call the node_load().

Summarizing there are 2 ways:

  1. all the developer using the load operation that call a theme's function should fix this behaviour in their modules;
  2. a little fix to blogtheme which, honestly, dont need the power of node_load() for its goal.

Obviously im lazy to change Service Links code and i suggest the second :P

I attach the patch against the blogtheme v. 1.4

rene_w’s picture

Status: Fixed » Closed (fixed)

Thanks a lot for figuring this out; I patched the blogtheme module as suggested and now have it working again with service links!

rene_w’s picture