Fix Undefined Array Key “url” in TableSorter Module by Updating Library Definition

Created on 27 February 2025, about 1 month ago

Problem/Motivation

When using the TableSorter module, the following error is encountered:

Warning: Undefined array key "url" in Drupal\Core\Asset\JsCollectionOptimizerLazy->optimizeGroup() (line 170 of /var/www/html/web/core/lib/Drupal/Core/Asset/JsCollectionOptimizerLazy.php)

This issue appears to be related to a known core bug described in [Drupal issue #3359497]( https://www.drupal.org/project/drupal/issues/3359497 🐛 Log an error message when library definitions have a license with no URL defined Needs work ). The error occurs when JavaScript asset optimization is enabled, causing issues in rendering or functionality.

Steps to reproduce

  1. Install and enable the TableSorter module.
  2. Enable JavaScript aggregation in Configuration > Development > Performance
  3. Visit a page that utilizes TableSorter functionality.
  4. Check the logs or the browser console for errors.

Proposed resolution

Update the mottie.tablesorter library definition in the module to include the correct url key under license.

This should resolve the undefined array key "url" issue.

Remaining tasks

Submit a patch and/or merge request

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States rishi kulshreshtha

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

Comments & Activities

Production build 0.71.5 2024