Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When we first time enable the option: Locally cache tracking code file, we got the local js query string none:
/sites/default/files/google_analytics/analytics.js?
The D8 code should be change from
$query_string = '?' . \Drupal::state()->get('system.css_js_query_string') ?: '0';
to
$query_string = '?' . (\Drupal::state()->get('system.css_js_query_string') ?: '0');
Then it will be the same as the D7 version:
$query_string = '?' . variable_get('css_js_query_string', '0');
Comment | File | Size | Author |
---|---|---|---|
#2 | google_analytics-fix-query-string-2876463-#2.patch | 646 bytes | Jieyyal |
Comments
Comment #2
Jieyyal CreditAttribution: Jieyyal commentedHere comes the patch.
Comment #3
hass CreditAttribution: hass commentedComment #4
hass CreditAttribution: hass commentedI cannot repro this. How can
system.css_js_query_string
be empty?Comment #5
hass CreditAttribution: hass commentedThis show the problem:
Comment #6
hass CreditAttribution: hass commentedComment #8
hass CreditAttribution: hass commentedNo idea how to test.