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

radiofranky2006 - July 15, 2006 - 06:51

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

geeloo - July 18, 2006 - 11:35

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

hickory - July 26, 2006 - 10:22

At line 303, change
if (($node->voting) && ($page)) {
to
if ($node->voting) {

#4

radiofranky2006 - July 27, 2006 - 04:47

both solutions are not working.. still not showing in teaser..

thanks for the help though

#5

oleykin - August 4, 2006 - 04:41
Priority:normal» critical
Assigned to:Anonymous» oleykin
Status:active» reviewed & tested by the community

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

AttachmentSize
voting.module 21.42 KB

#6

oleykin - August 4, 2006 - 04:43

Oops, attached the unchanged one, here is the working version!

Alex

AttachmentSize
voting_0.module 22.08 KB

#7

radiofranky2006 - August 4, 2006 - 06:55

i tried ur updated module, and still it is not working..

#8

radiofranky2006 - August 4, 2006 - 07:01

something is wrong with me..because i'm using UTC-8 characters..
i think there is something wrong wit voting database

#9

oleykin - August 4, 2006 - 15:34

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

radiofranky2006 - August 4, 2006 - 17:36

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

oleykin - August 4, 2006 - 23:04

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

radiofranky2006 - August 9, 2006 - 20:48

No, I haven't modify them.

it's very strange..

#13

KeithA - August 17, 2006 - 14:04

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

oleykin - August 17, 2006 - 21:41

works for me (check 43vents.com)

are you using english locale? there is apparently a problem with international websites.

#15

garg - September 10, 2006 - 17:43

After the patch it saves "yes" setting for the "show in teaser mode" but it does not show in teaser mode.

#16

Colin Brumelle - September 14, 2006 - 21:38

This patch worked for me, with the only caveat being that it only seemed to show the voting on newly created nodes.

#17

jorre - October 19, 2006 - 09:19

Still does not work, even with patched file... settings seem to be saved correctly, but not voting is shown on teaser...

#18

jwells - October 24, 2006 - 22:57

using Oct 4 cvs version

Seeing same thing - check raido button "yes" then "save"

radio button comes back "no"

#19

jim_at_miramontes - October 25, 2006 - 14:20

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:

<?php
if (($node->voting) && ($page)) {
?>

to:

<?php
if ($node->voting) {
?>

(2) In voting_nodeapi, change:

<?php
     
if ($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:
<?php
     
if ($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

frog - November 30, 2006 - 20:30

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

coltrane - January 10, 2007 - 23:14
Title:show voting in teaser doean't work» show voting in teaser doesn't work

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

dgtlmoon - February 14, 2007 - 06:20

heres the patch generated from the previous voting.module code submit that works for me, this should be added to the latest CVS

AttachmentSize
voting_0.patch 44.78 KB

#23

stevecrozz - February 14, 2007 - 19:37
Title:show voting in teaser doesn't work» dgtlmoon rocks

thanks, you made that easier than I could have ever hoped.

#24

coltrane - March 19, 2007 - 20:18
Title:dgtlmoon rocks» show voting in teaser doesn't work

restoring title

 
 

Drupal is a registered trademark of Dries Buytaert.