Needs work
Project:
AJAX Poll
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Feb 2011 at 22:30 UTC
Updated:
8 Oct 2018 at 01:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchHm, I'm open to patches but I don't use panels.
Comment #2
davidkronfeld commentedhad the same issue for poll inserted on page as block (not in panel): the form is not wrapped into class '.content'.
I solved it (drupal 6.19 and ajax_poll 1.1) by adding the following code in the function ajax_poll_form_alter:
the code will wrap the form into the required class.
sorry for not supplying the solution as patch - have no clue how to build it...
hope it helps though
David
Comment #3
quicksketchThat's an interesting solution David, but unfortunately won't work in all situations, like when working with the "Cancel vote" button, since it only wraps around the button and not the set of results. This probably isn't too big a problem since the Cancel button isn't usually displayed in blocks, but would be a problem if it were added.
A more direct route is ensuring that a "content" class is in your theme's block.tpl.php file. Just open it up and add an extra wrapper div around the contents of the block. See block.tpl.php in /modules/system/block.tpl.php or the default template provided by the Garland theme. Both include these wrappers.
The default block.tpl.php file provided by system module:
Comment #4
paranojik commentedThis patch ensures that the poll is wrapped in a known element.
Comment #5
paranojik commentedMight need review...
Comment #6
quicksketchThis patch is incomplete, as it will only work on forms, not on display of results (if the user is authenticated for example). It also doesn't work on the cancel form. This is generally a problem with the Poll module in that it has terrible default theming that makes it impossible to get a consistent wrapper. I honestly don't think there's a good solution here (other than to eventually fix the poll module).
Comment #7
dddave commentedsub :(
Comment #8
q11q11 commentedThou it searches first '.content' of all perents - I just added '.content' class in settings of pane itself
Comment #9
raulmuroc commentedNo patch is attached so 'Active'.
This problem affects to the rest of fields as well. For example, I have fields owned by a profile2 entity content type, and showed through panels. Their refresh/reload doesn't work at all. So the same problem as the one exposed here.
Comment #10
Tunox commentedI had a similar issue.
When clicking the vote button, poll wouldn't reload although the vote was taken into account. I had the poll block in different areas content, sidebar, pane.
As stated above adding a .content class (to the block in my case) did the trick.
I didn't consider this solution at first, because my Zen subtheme has an content div in it, but it was an ID #content and not .content. Double checking always helps.
Although this worked out for me, I'm really disappointed with the faulty design of the drupal's poll module. Conditioning module function logic to design elements that are bound to change it's simply not "proper".
Comment #11
jhedstromThe patch from #4 resolves this issue, and I'm not seeing any of the incompleteness mentioned in #6 (cancel button works, the display still works for users that cannot vote).
Patch from #4 rerolled without the CVS tags.
Comment #12
prashant.cAt first when we use ajax poll with panels it takes the vote but displays the result on a page refresh. After applying this patch submitted by #4 and re-rolled by #11 ajax poll works but doesn't display system status messages like "Your vote was recorded" etc. Because ".content" class is missing. I added this class to that particular poll pane in panels, status messages started working but now the issue is that after voting or cancelling the vote heading of the poll i.e. "Poll" disappears.
Comment #13
lsolesen commentedWhen applying the patch the reload gets correct. However, the links are multiplied.
So there are #12 and #13 issues outstanding before this should be committed.
Comment #14
sgdev commentedI'm using Panels, and should work correctly if you use the patch that already has been reviewed and accepted here: https://www.drupal.org/project/ajax_poll/issues/1240768
It is essentially trying to do the same thing (create a "wrapper" for the form), but in a slightly different manner. I don't think this patch is needed if #1240768 is committed.