From 818383a72d4a8234b96f32ffce4a0ec0c0aabe74 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 10 Nov 2014 14:50:43 -0500 Subject: [PATCH] CRM-15346 - Call Drupal.detachBehaviors conditionally for D6 support --- js/crm.drupal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/crm.drupal.js b/js/crm.drupal.js index fc0411aed2..4c1849cbc0 100644 --- a/js/crm.drupal.js +++ b/js/crm.drupal.js @@ -6,7 +6,10 @@ CRM.$(function($) { Drupal.attachBehaviors(e.target); }) .on('crmUnload', function(e) { - Drupal.detachBehaviors(e.target); + // This function doesn't exist in D6 so call conditionally + if (typeof Drupal.detachBehaviors === 'function') { + Drupal.detachBehaviors(e.target); + } }) .on('dialogopen', function(e) { // D7 hack to get the toolbar out of the way (CRM-15341) -- 2.25.1