Hello I'm not really sure if this is a bug but when I try to vote.. I was expecting that the total votes will increment but it didn't. and so I went to look at the js file and see that its basing on cid to update the votes.. and the cid is coming from vote_up_down.module line 299 and 305... In that line, Its calling $node->cid even if the node doesn't have a cid.. I think Its supposed to be nid since its a node? I've tried changing it to $node->nid and it works.

CommentFileSizeAuthor
#4 vote_up_down.test.patch1 KBAnonymous (not verified)
#3 This is my Story | localhost.jpg174.7 KBlyricnz
#1 vote_up_down.fixed_nid.patch1002 bytesAnonymous (not verified)

Comments

Anonymous’s picture

Title: Getting cid on node » Getting cid on node instead of nid
Status: Active » Needs review
StatusFileSize
new1002 bytes

I created a patch to fix the nid, please review.

lyricnz’s picture

Status: Needs review » Needs work

Please supply a simpletest demonstrating the failure happening, presumably fixed by the patch above.

lyricnz’s picture

StatusFileSize
new174.7 KB

I can confirm this issue - perhaps the original poster was unclear. A bug in the code means that the <span> doesn't contain the NID, which means that the Javascript can't find the element. See attached screenshot for problem.

Anonymous’s picture

StatusFileSize
new1 KB

Here's a patch for the vote_up_down.test file so it also checks if proper nid was returned.

lyricnz’s picture

Status: Needs work » Reviewed & tested by the community

Code looks good, test too. Thanks!

lut4rp’s picture

Status: Reviewed & tested by the community » Fixed

Fixed. Thanks!

Status: Fixed » Closed (fixed)

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