diff --git a/jquery_update.module b/jquery_update.module index 520e076..6b4415a 100644 --- a/jquery_update.module +++ b/jquery_update.module @@ -65,6 +65,12 @@ function jquery_update_library() { */ function jquery_update_library_alter(&$javascript, $module) { + // Don't update jQuery on admin pages if the variable jquery_update_exclude_admin is set to TRUE + // Fix for issue #2347525 - https://www.drupal.org/node/2347525 + if (variable_get('jquery_update_exclude_admin', FALSE) && user_access('view the administration theme') && path_is_admin(current_path())) { + return FALSE; + } + // We are updating just the system module. For all other cases we return. if ($module != 'system') { return; @@ -149,6 +155,11 @@ function jquery_update_settings_form() { '#default_value' => variable_get('jquery_update_jquery_cdn', 'none'), '#description' => t('Use jQuery and jQuery UI from a CDN. If the CDN is not available the local version of jQuery and jQuery UI will be used.'), ); + $form['jquery_update_exclude_admin'] = array( + '#type' => 'checkbox', + '#title' => t('Do not update jQuery within the Drupal administration interface'), + '#default_value' => variable_get('jquery_update_exclude_admin', FALSE), + ); return system_settings_form($form); }