On my website all comments need admin approval.
When I try to delete a comment (which was previously approved), the rating stays.

E.g. I can have all comments being deleted, but the Fivestar rating will remain untouched.

Thank you.

CommentFileSizeAuthor
#2 349900.patch1.25 KBezra-g

Comments

Timur5’s picture

I desperately need a fix, even a dirty one, or at least a direction where it all happens, so I can try to think of a tailor made quick fix.

(P.s. I temporary solved the problem of double votes on admin approved comments (http://drupal.org/node/331446 ) by simply dividing the final value by two. Logic: since all votes come double (all comments are approved by admin), we can divide the value by two without losing the sense behind data.

Now I'm stuck not able to delete the vote, which affects overall rating :(

ezra-g’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

I looked into this and found that the vote id was not specified when votes were inserted into the fivestar_comment table, causing comment-cast ratings to not be deleted. A patch is attached. Would be great to get someone's review here.

Also, marked #583932: Deleting comment does not delete rating a dupe of this.

ezra-g’s picture

Version: 6.x-1.13 » 6.x-1.19
ezra-g’s picture

Title: Rating for deleted comments stays (comments were approved by admin) » Comment-cast ratings not deleted when comment is deleted.
Status: Needs review » Reviewed & tested by the community

Actually, I think Fivestar just missed some updates to follow the VotingAPI and this is RTBC. Sadly, I'm having issues with my CVS account at the moment so I'll have to come back and commit this soon.

ezra-g’s picture

Status: Reviewed & tested by the community » Fixed

This is now committed. Catch it in the latest dev release after the next one is rolled.

ezra-g’s picture

Just wanted to cross reference #664446: Remove invalid data from fivestar_comment, votingapi_votes tables. for folks who experienced this issue, since you may want to remove the old invalid data from your database.

Timur5’s picture

I'm stupid, never mind the comments below. I forgot to update the fivestar to new version before applying the patch. I'll get back with the feedback as soon as I'm done.

--------------

tried the 349900.patch, it didn't produce expected results, unfortunately.

What I expected was: an non authenticated user leaves a 5 star comment. The comment requires approval by administrator.
Yet, an non-approved comment has already cast the vote and 5 stars are visible to all visitors. (not a problem so far).

The administrator comes to delete the 5 star comment, and deletes it (without ever approving it). But, here is the problem, the casted vote isn't deleted, it stays.
I thought the patch was trying to address this issue, or may be I'm missing the point?

I also tried approving the comment, and then deleting it, same trouble - the vote stays while the page no longer has any comments to it.

-------------

Timur5’s picture

It works!!!

After updating to 6.x-1.19 and applying the 349900 patch the anonymous comments+rating are deleted entirely when Admin comes to moderate the comments.
This will work only if Admin never approved the comment. If, however, the comment was approved and you want to delete it later, we have the old problem (which I know requires a lot of work and is still pending to the fix) - the voting saves two votes and only one will be deleted.

Happy new year!!!
Thank you everyone, great work!

ezra-g’s picture

Status: Fixed » Closed (duplicate)

Thanks for reporting here. As it turns out, this appears to be a duplicate of #601160: Comment-cast ratings not deleted with comment -- I missed the patch there because it was marked NW, but it addresses the fixes in this patch and changes an additional line. I'll follow up in that issue.