Why doesn't the voting module display for acidfree nodes?

Comments

vhmauery’s picture

why don't you ask the voting module folks?

cowb0y’s picture

Component: User interface » Miscellaneous
Category: support » bug

Looking at the acidfree table, visits are being recorded in the votes column.

From acidfree.module:

from function acidfree_view:
line 1047: acidfree_add_vote($node);

function acidfree_add_vote(&$node) {
if (!isset($node->nid))
return;
$query = "UPDATE {acidfree} SET votes=(votes+1) WHERE aid={$node->nid}";
db_query($query);
}

Every time a node is visited, _add_vote is called to update the votes column, instead of updating 'visited'.

Made the following change:
line 1047: acidfree_add_visit($node);

And ADDED the following function:

function acidfree_add_visit(&$node) {
if (!isset($node->nid))
return;
$query = "UPDATE {acidfree} SET visited=(visited+1) WHERE aid={$node->nid}";
db_query($query);
}

Now visits are correctly logged in the 'visited' column of table acidfree.

Not sure if this will affect the voting issue, though.

Jay

tom611’s picture

Component: Miscellaneous » Code
Priority: Normal » Critical

Wow, is this as serious as it sounds? Could this be why my voting module is no longer displaying? Please reply!

vhmauery’s picture

Status: Active » Closed (won't fix)

the whole votes and visited thing was a mistake I made long ago. You could probably just remove all references to votes and visited and be just fine. But since I can't really remove them in the distribution for fear of breaking existing setups, you will have to remove them in your setup manually.

drawk’s picture

Also, if tom611 or others are still having problems, they might want to try with the current cvs version of Voting. There were known issues interfering with the voting module showing up in certain circumstances.