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

CommentFileSizeAuthor
#22 voting_0.patch44.78 KBdgtlmoon
#6 voting_0.module22.08 KBoleykin
#5 voting.module21.42 KBoleykin

Comments

radiofranky2006’s picture

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. :)

geeloo’s picture

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...

hickory’s picture

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

radiofranky2006’s picture

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

thanks for the help though

oleykin’s picture

Assigned: Unassigned » oleykin
Priority: Normal » Critical
Status: Active » Reviewed & tested by the community
StatusFileSize
new21.42 KB

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

oleykin’s picture

StatusFileSize
new22.08 KB

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

Alex

radiofranky2006’s picture

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

radiofranky2006’s picture

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

oleykin’s picture

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

radiofranky2006’s picture

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 :(

oleykin’s picture

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

radiofranky2006’s picture

No, I haven't modify them.

it's very strange..

KeithA’s picture

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.

oleykin’s picture

works for me (check 43vents.com)

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

garg’s picture

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

Colin Brumelle’s picture

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

jorre’s picture

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

green monkey’s picture

using Oct 4 cvs version

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

radio button comes back "no"

jim_at_miramontes’s picture

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:

if (($node->voting) && ($page)) {

to:

if ($node->voting) { 

(2) In voting_nodeapi, change:

      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:

      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

frog’s picture

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.

coltrane’s picture

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?

dgtlmoon’s picture

StatusFileSize
new44.78 KB

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

stevecrozz’s picture

Title: show voting in teaser doesn't work » dgtlmoon rocks

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

coltrane’s picture

Title: dgtlmoon rocks » show voting in teaser doesn't work

restoring title

duaelfr’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

This version of Voting is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.