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

Nested divs when voting and cancelling

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.

Comments

michaellenahan created an issue. See original summary.

michaellenahan’s picture

StatusFileSize
new666 bytes

Here's the patch.

michaellenahan’s picture

Status: Active » Needs review
didebru’s picture

Fixed it for me -> thanks :)

sgdev’s picture

I 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 pollWrapper div so it manages new updates to the form correctly.

I'm fairly certain #1240768 fixes all these issues.