Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Trash 3.0.33 Minor update available for module trash (3.0.33). EOL Warning: Drupal 11.0 has reached end of life and no longer receives security updates. EOL Warning: Drupal 10.3 has reached end of life and no longer receives security updates. Release: UI Patterns (SDC in Drupal UI) 2.0.20 Minor update available for module ui_patterns (2.0.20). Release: Trash 3.1.0-rc1 First release candidate for module trash (3.1.0-rc1). Release: Country 2.2.0 Minor update available for module country (2.2.0). Usage Milestone: jQuery UI Datepicker Module jquery_ui_datepicker crossed 1,000 active installs. Release: Scheduler Content Moderation Defaults 1.1.2 Minor update available for module scheduler_content_moderation_defaults (1.1.2). Release: Flags 2.1.0 Minor update available for module flags (2.1.0). Release: Login Disable 2.2.0 Minor update available for module login_disable (2.2.0).

jQuery 4 Migrate

1 sites Security covered Drupal 11 · not 10
View on drupal.org

This module provides compatibility for JavaScript plugins that relied on functions removed in jQuery 4, which is bundled with Drupal 11. It adds a small script to restore these removed functions, allowing older plugins to continue working without immediate patching. This provides a temporary fix while site owners can update or replace the plugins themselves.

Starting with Drupal 11, Drupal core bundles jQuery 4 instead of jQuery 3. jQuery 4 removed several old functions - like jQuery.isFunction() and jQuery.type() - that had been marked "deprecated" for years but were still present and working right up until this version. A lot of older third-party JavaScript plugins (carousels, lightboxes, countdown timers, and similar widgets) still call these removed functions, so as soon as a site upgrades to Drupal 11, those plugins throw JavaScript errors and stop working - with no warning during the upgrade itself.

This module solves that by providing jQuery Migrate, a small compatibility script maintained by the jQuery Foundation. It adds the removed functions back as thin wrapper functions, so the old plugin code keeps working exactly as it did before, without you having to find, patch, or replace the plugin yourself.

Features

  • Packages jQuery Migrate 4.x as a standard Drupal library (jquery_4_migrate/jquery-migrate), so any custom or contributed library can declare it as a dependency, the normal Drupal way.
  • Optional sitewide toggle: rather than editing every broken library's .libraries.yml to add the dependency by hand, a single setting loads jQuery Migrate automatically wherever core jQuery loads.
  • The sitewide setting is gated behind its own permission, so only trusted roles can turn on a behavior that affects every page.
  • Acts as an immediate, non-invasive fix for plugins broken by the jQuery 3-to-4 transition, buying time to update or replace them properly later, without touching their code.

Post-Installation

  1. Enable the module.
  2. This module does not bundle the jQuery Migrate library file directly, per Drupal.org's policy against including third-party libraries in module repositories. Download the built file and place it in your Drupal installation's /libraries directory, at libraries/jquery-migrate/jquery-migrate.min.js.
  3. Go to Configuration > System > jQuery 4 Migrate Settings
    (/admin/config/system/jquery-4-migrate-settings). This requires the "Administer jQuery 4 Migrate" permission.
  4. Check "Enable jQuery 4 Migrate" to load it sitewide, or leave it unchecked and instead add jquery_4_migrate/jquery-migrate as a dependency to just the specific library that needs it.

Additional Requirements

  • No other contributed modules are required.
  • Requires manually placing the jQuery Migrate 4.x library file at /libraries/jquery-migrate/ (see Post-Installation above).
  • Only relevant on Drupal core ^11, where jQuery 4 is bundled. It has no effect on earlier core versions running jQuery 3.x.

None required. If you're trying to identify exactly which legacy plugin needs this, jQuery Migrate itself logs a console warning every time it patches a call to a removed API - your browser's JavaScript console is the fastest way to find the source.

Similar projects

The existing jQuery Migrate project bundles jQuery Migrate 3.x, which targets the jQuery 1.x/2.x-to-3.x transition. It's explicitly gated to only load when jQuery is >= 3.0 and < 4.0, so it does not help on Drupal 11's jQuery 4 - this module covers that gap specifically.

Community Documentation

This module deliberately trades a small amount of overhead (one more small script on every page that loads jQuery) for not having to hunt down and patch every legacy plugin individually. It's meant as a practical stopgap, not a permanent fix - if you rely on it for a specific plugin, that plugin is worth updating or replacing when you get the chance, since jQuery Migrate itself won't cover APIs removed in some future jQuery 5.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0 Stable 11 Jul 27, 2026
1.0.x-dev Dev 11 Jul 14, 2026