Problem/Motivation

Drupal 11.4 ships jQuery 4, which removed jQuery.trim(). js/module_filter.modules.js still calls it twice, at the lines that build the requiredBy and requires lists, so the Extend page throws a TypeError on Drupal 11.4.

The 4.x, 5.x and 6.0.x branches all still call it.

Steps to reproduce

  1. Install Module Filter 5.0.5 on Drupal 11.4.
  2. Visit /admin/modules.
  3. Open the browser console.

Proposed resolution

Replace both calls with the same null-safe trim that jQuery.trim() performed.

-  item.requiredBy.push($.trim(moduleName));
+  item.requiredBy.push((moduleName == null ? '' : String(moduleName).trim()));

Confirmed on Drupal 11.4.5 with jQuery 4.0.0.

Remaining tasks

Review the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kruser created an issue. See original summary.

smustgrave’s picture

Status: Needs review » Needs work

Fixes need to be in MRs.

kruser’s picture

Status: Needs work » Needs review

Moved the fix into MR !65.

  • kruser committed f2fae571 on 5.x
    Issue #3619268: Replace jQuery.trim(), removed in jQuery 4
smustgrave’s picture

Status: Needs review » Fixed

Fine with this.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.