Error when using together with eu_cookie_compliance module and js preprocess

Created on 8 February 2023, almost 2 years ago
Updated 3 April 2024, 8 months ago

Problem/Motivation

Error when using together with eu_cookie_compliance module and js preprocess.

Steps to reproduce

Add a inline js to a page.
Enable eu_cookie_compliance module.
In settings.php set $config['system.performance']['js']['preprocess'] = TRUE;
Try to open the page and will fail with:

TypeError: ksort(): Argument #1 ($array) must be of type array, null given in ksort() (line 34 of core/lib/Drupal/Core/Asset/JsCollectionGrouper.php).
ksort(NULL) (Line: 34)
Drupal\Core\Asset\JsCollectionGrouper->group(Array) (Line: 86)
Drupal\Core\Asset\JsCollectionOptimizer->optimize(Array) (Line: 142)
Drupal\eu_cookie_compliance\Asset\AssetResolver->getJsAssets(Object, 1) (Line: 319)

Proposed resolution

We just need to default browsers to empty array.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇪🇸Spain edurenye

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

Comments & Activities

  • Issue created by @edurenye
  • @edurenye opened merge request.
  • Status changed to Needs work almost 2 years ago
  • 🇪🇸Spain edurenye

    Aparently after fixing that there is still an error:

    Exception: Only file JavaScript assets can be optimized. in Drupal\Core\Asset\JsOptimizer->optimize() (line 17 of core/lib/Drupal/Core/Asset/JsOptimizer.php).
    
  • Status changed to Postponed: needs info about 1 year ago
  • 🇨🇦Canada gapple

    I don't see the Drupal\eu_cookie_compliance\Asset\AssetResolver class in either the 8.x-1.x or 2.0.x branches of eu_cookie_compliance

  • Status changed to Closed: cannot reproduce 8 months ago
Production build 0.71.5 2024