Use of "static" in callables is deprecated in Drupal\Core\Asset\AssetResolver->getCssAssets

Created on 20 January 2023, over 1 year ago
Updated 21 January 2023, over 1 year ago

Problem/Motivation

Uninstalling a core theme make AssetResolver::getCssAssets() trigger this PHP 8.2 deprecation PHP 8.2: Partially-supported callable are deprecated

Steps to reproduce

  1. Install Drupal 9.5.x and enable core themes.
  2. Uninstall Drupal core module, example Bartik
Error message

    Deprecated function: Use of "static" in callables is deprecated in Drupal\Core\Asset\AssetResolver->getCssAssets() (line 163 of core/lib/Drupal/Core/Asset/AssetResolver.php).
    Deprecated function: Use of "static" in callables is deprecated in Drupal\Core\Asset\AssetResolver->getJsAssets() (line 281 of core/lib/Drupal/Core/Asset/AssetResolver.php).

Proposed resolution

Example, change uasort($css, 'static::sort') to uasort($css, static::sort(...))

Remaining tasks

NA

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

🐛 Bug report
Status

Closed: duplicate

Version

9.5

Component
Asset library 

Last updated 1 day ago

No maintainer
Created by

🇳🇴Norway steinmb

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs review over 1 year ago
  • Status changed to Closed: duplicate over 1 year ago
Production build 0.71.5 2024