Update deprecated method of clearing CSS/JS cache

Created on 22 October 2024, 6 months ago

Problem/Motivation

While adding tests, I discovered a deprecation warning on the method of clearing the CSS/JS cache:

1x: The 'system.css_js_query_string' state is deprecated in drupal:10.2.0. Use \Drupal\Core\Asset\AssetQueryStringInterface::get() and ::reset() instead. See https://www.drupal.org/node/3358337.
    1x in NavigationExtraToolsAlterTest::testFlushCssJs from Drupal\Tests\navigation_extra_tools\Functional

This seems a cleaner way of clearing the CSS/JS cache so we should fix that.

Steps to reproduce

Run testFlushCssJs test.

Proposed resolution

Add the asset.query_string service as a dependency, then replace the current clear CSS/JS cache logic with a call to the ->reset() method.

Remaining tasks

Add dependency injection of asset.query_string
Add call to reset() method.

User interface changes

None

API changes

None

Data model changes

None

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024