[JS] Uncaught TypeError: $rows.sort is not a function

Created on 4 June 2024, 5 months ago
Updated 4 September 2024, 2 months ago

Problem/Motivation

With version 5.0.1 of the module and core 11.0.0-rc1 release and the following JavaScript error occurs in two different browsers too:

Steps to reproduce

  1. Install with Composer, enable with Drush
  2. Go to the module list page: /admin/modules
  3. Expected: all the existing modules are displayed on the list
  4. Experienced: the list is empty. Changing status of the three checkboxes have no effect at all.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

n. a.

Original issue summary

During the D11 upgrade of jquery_ui_autocomplete , I just needed another module that depends on it to test if it works. I've chosen module_filter as its 5.0.0 version is marked as D11-compatible. Required in Composer, installed, but when checking the /admin/modules listing page, no results showed up:

Disabling the module_filter module, the list is filterable again as before. I am also unsure about how this module is supposed to work as the core's default Claro theme already offers some Ajax-based filtering options.

🐛 Bug report
Status

Fixed

Version

5.0

Component

User interface

Created by

🇭🇺Hungary Balu Ertl Budapest 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Balu Ertl
  • Status changed to Postponed: needs info 5 months ago
  • 🇺🇸United States smustgrave

    If installed correctly this is what you should see

  • Status changed to Closed: outdated 4 months ago
  • 🇺🇸United States smustgrave

    Since there hasn't been a follow up going to close for now.

  • Status changed to Active 4 months ago
  • 🇭🇺Hungary Balu Ertl Budapest 🇪🇺

    I admit I missed checking the JavaScript console when first encountered the issue and opened the ticket. Now rechecked again and experienced the same, so reopened this ticket and retitled to describe the situation in more detail.

    Some “probably-irrelevant-but-who-knows-might-come-handy” backend information:

    • Web server: nginx/1.26.1
    • DB driver: 10.11.8-MariaDB-ubu2204-log
    • PHP version: 8.3.8
    • Memory limit: 1024M
  • First commit to issue fork.
  • Merge request !54Issue #3452347: Remove use of jQuery.sort → (Closed) created by clivelinsell
  • Pipeline finished with Failed
    4 months ago
    Total: 177s
    #234240
  • 🇬🇧United Kingdom clivelinsell

    `jQuery.sort` was removed in v4, and D11 is using that version. It just needs a slight tweak to sort an array instead.

    This is the first time I've used the MR flow, so apologies if something's not right.

  • Status changed to Needs review 4 months ago
  • Status changed to RTBC 4 months ago
  • 🇭🇺Hungary Balu Ertl Budapest 🇪🇺

    Hi @clivelinsell , thanks for the prompt solution. Now tested, commit d82cea90 eliminates the error message in the console and makes the list appear again indeed:

    Regarding the merge request-based workflow: no worries, only one suggestion I would give. Usually better to create a separate branch for your suggested solution (eg. 123456-resolution-approach-one). The Drupal․org GUI offers an input field pre-filled with a suggestion based on the ticket title. If it sounds weird as a branch name (sometimes it's not optimal) then you're able to rename it arbitrarily before creating the issue repo:

    Leaving the issue repository's default branches intact has a key benefit. This way anyone else coming up with a different idea for solving the same issue, can still open another branch (eg. 123456-resolution-approach-two) freshly stemming out from the original default branch (and open a separate marge request, of course). Finally, the project maintainers can decide which MR they agree with and get merged at the end.

  • Merge request !55Update file module_filter.modules_tabs.js → (Merged) created by smustgrave
  • Status changed to Fixed 3 months ago
  • 🇩🇰Denmark Uv516 Denmark

    Drupal 10.3.2:

    I have the same errors: No modules is showing at all.
    When I save Module filter settings (admin/config/user-interface/module-filter), the settings in the three fields disappear and I get the error shown in the attached image.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024