Problem/Motivation

With Drupal 10.2.x following deprecation notices found in logs when running webform related tests.

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.

Steps to reproduce

In webform/includes/webform.libraries.inc state called directly, needs converting to use the service:

/**
 * Implements hook_library_info_build().
 */
function webform_library_info_build() {
  $base_path = base_path();
  $default_query_string = \Drupal::state()->get('system.css_js_query_string') ?: '0';

Proposed resolution

Fix it according to https://www.drupal.org/node/3358337

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork webform-3425680

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

mitrpaka created an issue. See original summary.

mitrpaka’s picture

Status: Active » Needs review

jrockowitz made their first commit to this issue’s fork.

jrockowitz’s picture

I made a minor syntax tweak to align with other deprecations.

  // @todo Remove once Drupal 10.2.x is only supported.
  if (floatval(\Drupal::VERSION) < 10.2) {
    $default_query_string = \Drupal::state()->get('system.css_js_query_string') ?: '0';
  }
  else {
    $default_query_string = \Drupal::service('asset.query_string')->get();
  }

  • jrockowitz committed 141a6804 on 6.2.x authored by mitrpaka
    Issue #3425680: The 'system.css_js_query_string' state is deprecated in...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.