show voting in teaser doesn't work
radiofranky2006 - July 13, 2006 - 06:24
| Project: | Voting |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | oleykin |
| Status: | reviewed & tested by the community |
Description
I tried the new voting module and tried to set "show voting in teaser" but it doesn't work..
the check box always set to "no", no matter what I do. I have vote api installed

#1
i have resolved it.
the problem was in the DB.. all i did was re-load tables.
cheers,
oh.. teaser thing is still not workning. :)
#2
At line 59, change :
$form['general']['voting_location'] = array(in
$form['general']['voting_show_in_teaser'] = array(It will fix the behaviour of the form control.
But when applied the voting still doesn't appear in teaser...
#3
At line 303, change
if (($node->voting) && ($page)) {to
if ($node->voting) {#4
both solutions are not working.. still not showing in teaser..
thanks for the help though
#5
In addition to the bugs mentioned above the module had a number of other critical issues:
(1) In line 409, quering an unknown variable $node->voting = variable_get('voting_' . $node->type, 0);
should be voting_nodeapi_
(2) Throughout function voting_nodeapi(&$node, $op, $teaser, $page)
$node->voting which is a tiny int
is assigned variable_get("voting_nodeapi_{$node->type}", 'never'), which is a text
Attached is my re-write:
I tested:
- votes in teaser on /off >> check
- voting on different content types (project issue/story) set to always/never >> check
Did not play with 'usually' and 'sometimes' settings
Would be glad to hear any comments!
Yeah, this is all for 4.7
#6
Oops, attached the unchanged one, here is the working version!
Alex
#7
i tried ur updated module, and still it is not working..
#8
something is wrong with me..because i'm using UTC-8 characters..
i think there is something wrong wit voting database
#9
Did you try the second one that I sent? What exactly doesn't work?
If there is something wrong with the db, you should get a message in red, like table missing or something. Otherwise, it's fine.
Alex
#10
Hi,
I tried your patch on "english" based site and it works like a charm.
but when I tried on a "non-englisH" site, not just teaser, and whole node voting insertion didn't work.
not sure why, the encoding is UTF-8 :(
#11
Oh, i can see why... the code checks things like 'never' and 'always'
I assume you have modified those in non-english version, but the code still uses them.
There must be some generic way to replace those words with variable values... i 'll take a look.
Alex
#12
No, I haven't modify them.
it's very strange..
#13
oleykin, I used your patch to no avail. The settings work (I can now choose to Show voting in teaser), but actual voting doesn't show up anywhere now.
#14
works for me (check 43vents.com)
are you using english locale? there is apparently a problem with international websites.
#15
After the patch it saves "yes" setting for the "show in teaser mode" but it does not show in teaser mode.
#16
This patch worked for me, with the only caveat being that it only seemed to show the voting on newly created nodes.
#17
Still does not work, even with patched file... settings seem to be saved correctly, but not voting is shown on teaser...
#18
using Oct 4 cvs version
Seeing same thing - check raido button "yes" then "save"
radio button comes back "no"
#19
I was having the same teaser-related problem as before, but got it working with two changes to the Oct 3 CVS release:
(1) As discussed earlier, in voting_control_node, change:
<?phpif (($node->voting) && ($page)) {
?>
to:
<?phpif ($node->voting) {
?>
(2) In voting_nodeapi, change:
<?phpif ($node->voting) { // if voting is enabled for this node and this view (votes don't show on teasers)
switch (variable_get('voting_location', 1)) {
case 0: // display above the node
$node->body = voting_control_node($node, $teaser, $page) . $node->body;
break;
case 1: // display below the node
$node->body .= voting_control_node($node, $teaser, $page);
break;
case 2: // do not display
}
}
?>
to:
<?phpif ($node->voting) { // if voting is enabled for this node and this view (votes don't show on teasers)
switch (variable_get('voting_location', 1)) {
case 0: // display above the node
$node->body = voting_control_node($node, $teaser, $page) . $node->body;
if ($teaser) {
$node->teaser = voting_control_node($node, $teaser, $page) . $node->teaser;
}
break;
case 1: // display below the node
$node->body .= voting_control_node($node, $teaser, $page);
if ($teaser) {
$node->teaser .= voting_control_node($node, $teaser, $page);
}
break;
case 2: // do not display
}
}
?>
The ratings code wasn't getting written into $node->teaser for display when the node is rendered (as a teaser).
Thoughts? I'm worried that I'm brute-forcing something...
Jim
#20
I've implemented all of these suggestions. I can't get any voting dialogue to show up anywhere. I've created new nodes, looked at the nodes and the teasers. Ultimately, I am trying to make the voting work on my custom nodes, but since it won't work on any page or anything, it seems the module is pretty much not working, though I see absolutely no errors anywhere.
#21
The solution provided by jim_at_miramontes worked for me to fix this problem. For those of you who haven't gotten this to work have you tried using other themes? I'm using custom themes and it works but perhaps it's a problem with your current theme?
#22
heres the patch generated from the previous voting.module code submit that works for me, this should be added to the latest CVS
#23
thanks, you made that easier than I could have ever hoped.
#24
restoring title