Ctools autosubmit sends two ajax requests when a view having exposed filters is rendered in a Ctools modal when Autosubmit is enabled for the exposed filters.

Comments

aaghran’s picture

Title: Ctools Autosubmit sends two ajax post requests in Ctools Modal » Adding a proposed fix.
Status: Active » Needs review
StatusFileSize
new921 bytes

In the current ctools version we use (version = "7.x-1.4")
File ctools/js/modal.js , line 258.
In this function it has been made use that if a submit is triggered via .click() event the as Drupal used jQuery 1.4, this wont work. So it triggers form submit. However we have updated to jQuery 1.8 and this is not needed.

$('inputtype=submit, button', this).click(function(event) {
Drupal.ajaxbase.element = this;
this.form.clk = this;
// An empty event means we were triggered via .click() and
// in jquery 1.4 this won't trigger a submit.
if (event.bubbles == undefined)
{ $(this.form).trigger('submit'); return false; }
});
parisek’s picture

Title: Adding a proposed fix. » Support for newer jquery versions in modal.js
Status: Needs review » Closed (duplicate)
Related issues: +#1198808: auto-submit in combination with modal frame, +#1823088: Autosubmit forms in modals are broken

I can confirm same behavior with editablefields and jquery update module. Submit handler is triggered twice and error message with ajax 200 is shown.

Proposed patch resolves this issue, but this code was added on purpose in issue #1198808. It's not a good solution to completely delete it :) I found same issue with better patch.