|
Hiya,
This is in 1.8.8 - as far as I can see there isn't an ajax rating option in forums - I certainly can't see it in the forum settings page. And ajax is turned off for the whole site in admin | miscellaneous. The rating is just a drop-down list over on the lower right of the message box. Sean K Hi,
I guess it's some sort of problem with one new security check introduced in MDL-17365 (by me too). I tested it over 1.9 and HEAD and then backported to 1.8 and 1.7 (without conflicts). Anyway... I'd suggest you, as immediate solution, to revert to mod/forum/rate.php version 1.22 (that was the one before I applied the security changes). That should fix the problem temporarily. I'm going to test 1.8 and 1.7 and fix them in CVS ASAP. Will note about that here. Ciao Uhmm... strange. Just connected to my 1.8 test site and I discovered some test forums used recently to test ratings. I've tested that again, both with 0-100, 0-20 and custom scale... and it seems to work perfectly here, only getting the error if I try to send (by hacking the page) one invalid rate.
In fact, the error you posted above: "Invalid Rate (568)" means that somebody is trying to send one rate of 568 and that is obviously erroneous in one 0-20 scale. Can you send the HTML output of the discussion being rated and causing the problem to see what values are in those menus internally? I'd expect 0-20 values, but not 568 at all (in fact that's why the new check was introduced, to prevent those invalid values to be processed). Ciao OK, I've attached the output of that screen as a text file.
This file is the output from the forum discussion screen, as requested by Eloy.
Thanks a lot Sean! Looking the page right now.
Aha, found it!
it seems that since some time ago the ratings form uses to send: id = the forum id but code in rate.php was trying to evaluate the forumid parameter as one more rate. So, I've made a small fix that discards everything but the [array of rates] to be considered rates. Affected versions were 1.7 and 1.8. Changes are in CVS now. One more question... old (wrong) behaviour could have been creating "fake" records in the forum_ratings table. Can you try this query in your server: SELECT * from mdl_forum_ratings WHERE postid=0 Perhaps we'll need to do an upgrade step in the module to "clean" all those fake records (that don't cause any problem but their own existence). Thanks a lot for the file, it helped to determine the problem (and also proved that the security check is working!). Ciao The same problem affects me.
When I tried the query suggested, I find 134 records with post<>0 and 82 with post=0 with a 1.8.8 updated Moodle running since summer 2007 (not too much ratings, I know) Perhaps i don't understand the fix, but my question is if some forums works and others don't, or all forum could fail this manner?. And if only some of them fail, what is the recommended way to fix it? Updating to 1.8.9 version? Or my Moodle is goint to create fakes records until I delete the old forums and create another ones? Thanks in advance Hi Fernando,
step 1 is to upgrade to latest 1.8.x (in your case) version available. That will stop creating new fake records completely. This is the important step to perform. step 2 is to upgrade to 1.9.x because that version will be the one "cleaning" those 82 fake records from your table (but that isn't 100% necessary if you don't plan to upgrade to 1.9.x soon, those records won't cause any disruption to your system). I'll introduce the cleaning along this week in Moodle 1.9.x. Still it isn't there (hence, this bug remains open) ciao Done,
the cleaning of fake records have been implemented in 19_STABLE and HEAD. Resolving as fixed. Ciao |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sean, can you try turning the ajax rating off? forum_ajaxrating