Steps to reproduce

  1. Define a library in a *.libraries.yml file with a license key that does not include a url sub-key
  2. Enable CSS/JS aggregation (/admin/config/development/performance)
  3. Visit a page that includes that library

Actual result

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

Expected result

No PHP warning. The license comment should be output gracefully even when url (or name) is missing from the license array.

Issue fork drupal-3588534

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

dtrdewaele created an issue. See original summary.

dtrdewaele’s picture

Issue summary: View changes
dtrdewaele’s picture

Version: main » 11.3.x-dev
cilefen’s picture

This actually should be the main branch unless it's a rare bug affecting only 11.3.x.

dtrdewaele’s picture

Version: 11.3.x-dev » main

dtrdewaele’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Sounds like we probably need some validation to make sure those keys exist with the library, seems incorrect to not include

dtrdewaele’s picture

Detected this issue because https://www.drupal.org/project/magnific_popup causes it, but indeed, better validation could be a better solution for this.