diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php index b9f6582..a251bff 100644 --- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php +++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php @@ -35,7 +35,7 @@ public function render(array $js_assets) { // Since JavaScript may look for arguments in the URL and act on them, some // third-party code might require the use of a different query string. - $js_version_string = variable_get('drupal_js_version_query_string', 'v='); + $js_version_string = \Drupal::state()->get('system.js_version_query_string') ?: 'v='; // Defaults for each SCRIPT element. $element_defaults = array( diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 7777e0c..90a7957 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2267,6 +2267,18 @@ function system_update_8060() { } /** + * Convert drupal_js_version_query_string variable to state API. + * + * @ingroup state_upgrade + */ +function system_update_8061() { + if ($value = update_variable_get('drupal_js_version_query_string', FALSE)) { + Drupal::state()->set('system.js_version_query_string', $value); + } + update_variable_del('drupal_js_version_query_string'); +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */