Rating and recast

bic Member, Translator
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.

Comments

  • 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.)
  • bic Member, Translator
    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 }
    ..
    `
  • Thanks. we will get the mainline code updated to reflect this.
    [edit] Sorry, but I cannot reproduce the original issue with the current release.
  • bic Member, Translator
    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..
  • Well, when I do this, deleting the rating is not processed. Gives "nothing to post" message.
  • bic Member, Translator
    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
  • Ok, got it. There is also a bug in the rating plugin--you cannot re-rate the image without first refreshing the screen.
  • bic Member, Translator
    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
  • The full correction will be in tonight's build.
Sign In or Register to comment.