After voting on a poll, it doesnt show the poll results. The page has to be refreshed before i see them.

The button momentarily changes to "Voting.." when its clicked but doesnt change to "Cancel your vote" until page refresh.

I should also note that im display the poll using Views show:content|full content

Comments

quicksketch’s picture

Have you done any theming to your polls? Changing the HTML markup may break AJAX Poll. Does the AJAX functionality work if you enable the latest poll block? Or when you view the node directly?

tinny’s picture

I removed all theming to the polls, used the latest poll block and viewed the node directly and it doesnt get updated. It still needs to be refreshed.

quicksketch’s picture

Hm, so you're basically saying that on a fresh install of AJAX Poll, nothing works. Unfortunately I can't reproduce such a problem. I need to be able to know what's causing the breakage in order to reproduce the problem.

udhaya kumar’s picture

Assigned: Unassigned » udhaya kumar

Hi
Try the below fix it should resolve your issue.
File - sites/all/modules/ajax_poll/ajax_poll.js
In the above .js file mentioned comment line 16 and add below mentioned line.

Line 16 Commented :
//var $pollWrapper = $form.parents('.content, .poll').filter(':first');
Added line 17 insted the above.
var $pollWrapper = $form.parent('.content, .poll').filter(':first');

http://drupal.org/node/915876
http://drupal.org/files/issues/ajax_poll-915876.patch

Thx

udhaya kumar’s picture

Issue summary: View changes

added more details

jonhines’s picture

I had a similar issue. I built a fast 1 page site and used the teasers to show all my content. As a result, the parent dom node did not have the "content" class so the $pollWrapper variable was not filled and no content replacement occurred. I fixed the issue by changing line 16 to:

var $pollWrapper = $form.parent();

I realize that this may not work in all cases but it works fine for my use case.

qqboy’s picture

Issue summary: View changes

#5 working for me thanks.

i change both #4 and #5 code.

but the strange thing is same module works in a live site but not in my fresh development site.

thanks.

jienckebd’s picture

#5 worked for me too -- thanks!

LoonyLuna’s picture

Worked for me too! Thanks

LoonyLuna’s picture

StatusFileSize
new747 bytes

Here is the patch to #5 -- worked well. Thanks

garbo’s picture

Status: Active » Reviewed & tested by the community

Patch of #5 works!

firewaller’s picture

StatusFileSize
new619 bytes

The above patch did not apply. I had an issue with a vanilla Drupal install with an Omega 4 subtheme. Turns out the form parent class changes, so I added it. See updated patch.

firewaller’s picture

StatusFileSize
new580 bytes

I rerolled the patch from #9. Please ignore my above patch #11.

jenlampton’s picture

+1 on RTBC

jenlampton’s picture

StatusFileSize
new584 bytes

Slight reroll of the patch in #12 since it didn't apply cleanly for me.

mhmd’s picture

This patch fixed the issue.

mhmd’s picture

StatusFileSize
new735 bytes

When using most recent block the block title became hidden after submitting the poll, attached patch fixing the issue

sgdev’s picture

A couple of issues. First, @mhmd, your addition is a patch of a patch. Patches need to be against the module's dev branch, not another person's patch.

Second, this is the *third* patch attempting to solve the same problem. All in various states of acceptance.

This one has been RTBC since 2012, and @quicksketch said he would commit it: https://www.drupal.org/project/ajax_poll/issues/1240768

This one (https://www.drupal.org/project/ajax_poll/issues/1048064) tries to do something very similar, and if #1240768 is committed, it is unnecessary.

I'm fairly certain #1240768 solves all three of these threads.