We noticed this problem when voting and then cancelling a vote multiple times.

The problem is in ajax_poll.js.
Line 17 (in version 7.x-1.1) we have this.
var $pollWrapper = $form.parent();
Later in the code (line 40), $pollWrapper gets replaced:
$pollWrapper.html(response.output);
Next time round, line 17 finds the form's parent, but it's incorrect.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nested_divs_when_voting-2662538-2.patch | 666 bytes | michaellenahan |
| ajax_poll.png | 33.39 KB | michaellenahan |
Comments
Comment #2
michaellenahan commentedHere's the patch.
Comment #3
michaellenahan commentedComment #4
didebruFixed it for me -> thanks :)
Comment #5
sgdev commentedI believe this is now the 4th patch all trying to fix the same issue:
https://www.drupal.org/project/ajax_poll/issues/1368064
https://www.drupal.org/project/ajax_poll/issues/1048064
https://www.drupal.org/project/ajax_poll/issues/1240768
The patch in #1240768 has been RTBC since 2012. Every other patch tries to do something similar, which is making changes to a
pollWrapperdiv so it manages new updates to the form correctly.I'm fairly certain #1240768 fixes all these issues.