ZenphotoCMS Forum
Rating and recast - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html)
+--- Thread: Rating and recast (/thread-7068.html)



Rating and recast - bic - 17-05-2010

I'm using zenphoto version 1.2.5_RC2 [4019] since about one year.
I'm very happy with it and I want to thanks again all the developers for their work.
Now I've found a small problem in this plugin.
I had a look to the latest version of ZP and it seems still present, so I bring it to your attention.

If you remove your rating without insert a new value the total_votes in database remains the same as it was before, so next time you (or someone else) vote the value is divided by actual total votes + 1.

The solution I found is to add this line in update.php:
if (!$rating) {$voting = -1;}
at line 71 in my version of the plugin or at line 78 in the latest (official) version.




Rating and recast - sbillard - 17-05-2010

Thank you for your report. Unfortunately, my copy of the current version of the plugin script file does not go to line 78 (or even line 71) so I fear there is no action we can take on your report.

Just FYI, 1.2.5_RC2 is not even an official release of the 1.2.5 version of Zenphoto much less a curent version (1.2.9, soon to be 1.3.0.)




Rating and recast - bic - 17-05-2010

Yes, I know I should update. I want to test the new version of ZP on my local server but I have no time atm.

Anyway if you want to check what I am sayng the line in the latest SVN is N. 41.
Near the end of the script, after
35 if ($oldrating) { 36 $voting = 0; 37 $valuechange = $rating-$oldrating; 38 if ($valuechange>=0) { 39 $valuechange = '+'.$valuechange; 40 }
and before
41 } else { 42 $voting = 1; 43 $valuechange = '+'.$rating; 44 } ..




Rating and recast - sbillard - 17-05-2010

Thanks. we will get the mainline code updated to reflect this.
[edit] Sorry, but I cannot reproduce the original issue with the current release.




Rating and recast - bic - 18-05-2010

To me the issue is still present. I've installed the latest SVN on local server just to check this. The solution works here too.

Note that this appens only if you retire your vote, not if you just change it.

  1. Pick a not rated photo
  2. Rate it to 5 stars and refresh the page
  3. Delete your rating and refresh the page
  4. Rate it again to 5 stars and refresh
  5. Now you should see the issue. The rating will be 2.5 with 2 votes instead of 5 with 1 vote..



Rating and recast - sbillard - 18-05-2010

Well, when I do this, deleting the rating is not processed. Gives "nothing to post" message.




Rating and recast - bic - 18-05-2010

Ok, I'm ready to give up, but to me "nothing to post" appens only if I try to delete rating from an unrated picture. If I've rated it before then I can delete rating..
Quite strange btw




Rating and recast - sbillard - 18-05-2010

Ok, got it. There is also a bug in the rating plugin--you cannot re-rate the image without first refreshing the screen.




Rating and recast - bic - 18-05-2010

Oh, I considered it a regular behavior. That's why you didn't see the update problem at once!
Thanks again for this wonderful CMS!
Ciao




Rating and recast - sbillard - 18-05-2010

The full correction will be in tonight's build.