diff --git a/jquery_update.module b/jquery_update.module index 28c82c0..e7ce668 100644 --- a/jquery_update.module +++ b/jquery_update.module @@ -107,6 +107,16 @@ function jquery_update_library_alter(&$javascript, $module) { if ($theme_version && version_compare($version, $theme_version, '!=')) { $version = $theme_version; } + + // Allow other modules to override jquery version by path. + $alter_paths = array(); + drupal_alter('jquery_update_paths', $alter_paths); + foreach ($alter_paths as $pattern => $alter_version) { + if (drupal_match_path(request_path(), $pattern) || drupal_match_path(current_path(), $pattern)) { + $version = $alter_version; + } + } + // If the ajax version is set then that one always win. if (!empty($_POST['ajax_page_state']['jquery_version'])) { $ajax_version = $_POST['ajax_page_state']['jquery_version'];