Some how after node that contained a voting get deleted, the voting api tables dont seem to update. After a quick look at the code i couldn't find a Hook_node_delete. Is this normal ?

Comments

ericduran’s picture

Sounds like a bug.

But the hook shouldn't be hook_node_delete.

If anything it'll be an entity delete hook.

silkAdmin’s picture

Yes right, so if i want to implement that can i safely delete entries that match my deleted entity ID in the table `votingapi_cache` and `votingapi_vote`?

ericduran’s picture

@silkAdmin the proper way would be to have votingapi delete the votes. This will also allow votingapi to re calculate is caches.

Have a look at the votingapi documentation. Or how we're deleting votes in d6 for the correct votingapi functions.

silkAdmin’s picture

Ok thank you Eric, i ll investigate that.

nafmarcus’s picture

I seem to have the same problem. Has this been fixed / resolved?

Here's my scenario:
There is currently 1 vote cast by node #21253 (a review) on the target node #18439 (product).

If we look in the votingapi_vote table, there are 7 entries and in the votingapi_cache table, there is a count value of 7.
Votingapi_votes
218 node 18439 100 percent Overall_Rating 4 1344029019 127.0.0.1
219 node 18439 100 percent Overall_Rating 4 1344029097 127.0.0.1
220 node 18439 100 percent Overall_Rating 4 1344029298 127.0.0.1
221 node 18439 100 percent Overall_Rating 4 1344029340 127.0.0.1
222 node 18439 100 percent Overall_Rating 4 1344029397 127.0.0.1
224 node 18439 100 percent Overall_Rating 4 1344029862 127.0.0.1
225 node 18439 100 percent Overall_Rating 4 1344030417 127.0.0.1

The problem is that I currently only have one review, #21253 that has a vote relating to #18439.
field_data_field_overall_rating
node product_review 0 21253 21255 und 0 100

Firstly, could you possible explain how each entry in the votingapi_vote table knows which node it belong to? The target nid is clear but not the node that cast the vote.

And secondly, any suggestion of how to fix this problem? The vote count is very important to our site.

dbt102’s picture

Issue summary: View changes

I'm marking this as fixed,

1. since VotingAPI is now at 7.x-2.12 on 2014-Aug-14, and
2. per comment #3 the proper way to do it is to have votingapi delete the vote, and
3. the last update was is 2012 ... 5 years ago

Thanks for everyone's effort in reporting the issue and explaining the resolution.

dbt102’s picture

dbt102’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.