Closed (fixed)
Project:
Vote Up/Down
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
26 Mar 2009 at 12:43 UTC
Updated:
25 Aug 2009 at 15:00 UTC
I voted node 3 with +1 fln node 5 with -1
I got "points -1" under all teasers on my frontpage.
IAnother user voted node 3 with +1 too and now "points 2" is under any teaser and node.
There is all right on node/%/votes page - all votes saved, so that's theming issue.
Comments
Comment #1
Rabik-1 commentedI get the same after updating 5-->6
What's the problem?
Comment #2
parrottvision commentedI have the same problem but can't find why.
Comment #3
parrottvision commentedIt looks fine in the DB. All the nodes have the correct votes against them. Trouble is - how can I troubleshoot to find the theme issue as it does it on Zen and Garland?
Comment #4
parrottvision commentedOK - I just went in a deleted all references to vote_up_down and vote api in the DB and started install from scratch - all good now.
I also had a vote_up_down_BUP folder in the modules folder which was stupid. That might have confused things but I don't think so as problem existed before the backup folder was made.
So - if in doubt start from scratch and clear all reference to modules in system and variables tables and delete and reinstall voteapi and vote_cache tables in DB (although this will delete all votes etc to date so be warned).
Comment #5
x3ja commentedSame problem here - all forum posts have exactly the same votes.
However, the View that links into votingapi shows the correct scores, so this seems to be a problem with vote_up_down...
Comment #6
x3ja commentedI am working on a project using Drupal 6 (6.11 at the moment, haven't yet upgraded to 6.12) and part of the core functionality is the ability to vote on nodes. I'm having some rather weird behaviour that has taken me an age to track down and now I have, I still can't fix it.
This is what I've managed to figure out so far:
* The template file sites/default/modules/vote_up_down/theme/vote_up_down_points.tpl.php automatically calls the function template_preprocess_vote_up_down_points() from vote_up_down.module.
* vote_up_down.module then queries the database using the values stored in the $variables array that is passed to it
* On only one of the 3 occasions this is called on a typical node (in this case forum posts) $variables doesn't have a value for $variables['cid'].
* That one occasion is when it reads the score so as to display it below the post itself. And, instead of locating the current post's score, it locates the first-ever-voted-on post's score. (This is because instead of returning the score of one post, it returns the score of all posts and then uses the first one from the list).
I am assuming that $variables is a system-wide constant (looking at the content of it using print_r seems to confirm that) and so perhaps this is a core bug as it should always be the same. I checked the contents of $variables and the only 4 parts of around 50 that are different in the one that doesn't work are: cid - blank, tag - blank (although this is discovered by the function and correctly substituted as 'vote'), zebra - even & id - 2. I imagine the last 2 are not really important for this, so the key must be in why $variables['cid'] is not being passed through.
Just as some further info for this issue...
Comment #7
ahynes1 commentedThere appears to be a bug in vote_up_down.module
For version 1.24.2.28 2009/3/35
Line 299 and line 305 both pass a parameter $node->cid The parameter should be $node->nid
Fixing that parameter in those to lines should fix this bug.
Comment #8
lyricnz commentedThis is the bug from #417916: Getting cid on node instead of nid which is fixed in -dev.
Comment #10
ingo86 commentedUhmm..it was not fixed in dev. I added a new issue without looking this issue, i fixed it and committed.
Comment #11
Michsk commentedingo is correct i to had to change it in the .module node->cid to node->nid