Ctools breaks "change" event handlers:

  Drupal.CTools.dependent.autoAttach = function() {
    // Clear active bindings and triggers.
    for (i in Drupal.CTools.dependent.activeTriggers) {
      $(Drupal.CTools.dependent.activeTriggers[i]).unbind('change');
    }

  Drupal.behaviors.CToolsDependent = {
    attach: function (context) {
      Drupal.CTools.dependent.autoAttach();
    }
  }

So if a form element controls dependent elements, and this element has other "change" event handlers, these handlers will not be active any more after any AJAX action on the page which invokes Drupal.attachBehaviors().

Comments

maximpodorov’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

This patch adds namespace to "change" event in dependent.js.

cadila’s picture

Status: Needs review » Reviewed & tested by the community

Good thing!

mrjmd’s picture

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

I think this explains a weird form ajax problem when using a form control with ctools. This patch fixed it. Committed.

  • japerry committed 125023c on 7.x-1.x authored by maximpodorov
    Issue #2381681 by maximpodorov: Incorrect unbinding in dependent.js
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.