We running Drupal 5.1 and have multiple subthemes being applied to different sections of our site. Each subtheme has a distinct set of blocks assigned to it. Some blocks are shared between sections however we had to go in to each theme individually and assign the blocks to the proper positions. After enabling jRating, none of the block assignments where accessible on the Blocks page using the Theme tabs. Only the default theme was able to receive block assignments which then didn't carry over to any of the subthemes. After disabling jRating, things went back to normal and the original block assignments were applied correctly.
Similar to the issue being detailed in this post for a different module, http://drupal.org/node/59702 Maybe a factor in the admin theme issue for jRating?
Comments
Comment #1
extrabigmehdi commentedhi
I got the same problem with the official version (i.e not dev).
and I don't understand why such important bug was not fixed yet.
Anyway, I found a quite easy fix:
near line 38 of file jrating.module,
replace the following code:
by this one:
Seems that the call of the function "theme" is unnecessary here, and is inducing the problem.
Comment #2
hickory commentedThe use of theme is necessary here, as it allows you to set the action that should be called in javascript after the vote is made.
What I don't understand is why this is interfering with other theme functions.
(It hasn't been fixed yet because I'm not using multiple themes, so haven't got this problem).
Perhaps this could be made configurable by including a javascript file from the theme folder instead...
Comment #3
extrabigmehdi commentedhi hickory,
If I'm not wrong , the function theme_jrating_postsubmit always return true by default. I looked trough all the code of jrating , searching for the string "jrating_postsubmit" , and found nowhere a code that modify such behavior.
Also, It seems to work, so I don't know what dysfunctions my fix introduce.
Well, I like to use at least two different themes one for frontend, and one for backend. I think that's important to make a clear distinction, especially, if you begin to use drupal.
I just began to use drupal, and I'm not very familiar with API. However , according to this thread my guess is that the problem comes from the call of the init_theme function by the theme function itself. Perhaps , you should take a look at the actual implementation of the theme function here
Comment #4
hickory commentedIt's a themeable function, so you can override it in your theme file to change the action that happens after a vote is placed.
Comment #5
ms2011 commentedI'm experiencing the same problem. I confirm the patch from #1 works for me.
Comment #6
pippi commentedsame problem......
Comment #7
sanduhrsAnother workaround would be to _not_ add the JavaScript on admin pages.
Comment #8
hickory commentedThe explanation for this is in http://drupal.org/node/64409#comment-408346 - I'll have to move the theme function out of hook_menu or hook_init.
Comment #9
hickory commentedRemoved the theme function call. jrating_postsubmit can now be defined in a javascript file included by an individual theme or module.
Comment #10
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.