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.
Problem/Motivation
We need a Drupal 8 version for the module.
Proposed resolution
Help porting and fixing the remaining Drupal core bugs.
Remaining tasks
- Test that JS files added in hook_page_alter()/hook_page_build() are aggregated - hook_page_build() is the recommended way to attach CSS/JS
Resolved tasks
- Basic porting has been completed, but Drupal moves every day.
- Cannot remove drupal_add_js() from hook_search_results() - #attached seems not working (blocker)
- #1798738: Move css_js_query_string to state system
- #2112739: Upgrade "Track translation sets as one unit" feature
- #1969270: 403/404 pages: drupal_get_http_header('Status') returns no status code at all (blocker)
User interface changes
None.
API changes
Unclear.
Comment | File | Size | Author |
---|
Comments
Comment #1
darrell_ulm CreditAttribution: darrell_ulm commentedHere is the patch to upgrade the latest dev to Drupal 8. Most things test out, although we may need to update how drupal_add_js is used. This makes the menus work in Drupal 8, so we can get started.
and my patch attribution
Pass the following option to git commit to attribute authorship to this user:
Learn more about proper Git attribution.
Hey-thank you!
Comment #3
hass CreditAttribution: hass commented#1903586: Create Drupal8 Branch
Comment #4
hass CreditAttribution: hass commentedReopening this case as the title fits best and the case has a patch.
Comment #5
darrell_ulm CreditAttribution: darrell_ulm commented#1: google_analytics-Drupal_8_upgrade-1948588.patch queued for re-testing.
Comment #6
hass CreditAttribution: hass commentedThis will fail...
Comment #7
darrell_ulm CreditAttribution: darrell_ulm commentedAnd...you are correct.
I'll take a look at updating it later when I get a chance, or someone else can.
Cheers,
Comment #8
hass CreditAttribution: hass commentedWork in process, does not contain changes from #1 and produces
No idea what's wrong, just sharing my latest code. Ideas welcome!
Comment #9
hass CreditAttribution: hass commentedLatest patch. Needs help! #1962876: Misleading error message: Symfony ServiceNotFoundException: You have requested a non-existent service
Issue #8 still exists, but stuff in hook_page_alter() works. Main issues are in the setting form.
Comment #10
hass CreditAttribution: hass commentedFixed variables in submitForm()
Comment #11
hass CreditAttribution: hass commentedCurrent_path(), http://drupal.org/node/1888424#comment-7283326
Comment #12
hass CreditAttribution: hass commentedSettings form works. Let's see how the tests are failing.
Comment #13
hass CreditAttribution: hass commentedUpgraded tests files, a few tests are failing.
Comment #14
hass CreditAttribution: hass commentedCommitted latest code for now to remove form patch issue.
http://drupalcode.org/project/google_analytics.git/commit/7f993f0
Comment #14.0
hass CreditAttribution: hass commentedA
Comment #14.1
hass CreditAttribution: hass commentedA
Comment #14.2
hass CreditAttribution: hass commentedA
Comment #15
hass CreditAttribution: hass commentedMoved
google_analytics.settings.last_cache
to state system per #1775842: [meta] Convert all variables to state and/or config systems.http://drupalcode.org/project/google_analytics.git/commit/b47f207
http://drupalcode.org/project/google_analytics.git/commit/a60a5a6
Comment #15.0
hass CreditAttribution: hass commenteda
Comment #15.1
hass CreditAttribution: hass commenteda
Comment #16
chertzogAttached is a patch which addresses a few small things i needed to get up and running.
Comment #17
hass CreditAttribution: hass commentedThis is not against latest DEV and seems to contain a lot of unnecessary changes.
Comment #18
chertzogthe js variable name changes were because in chrome the Google_Analytics.* variables throw warnings.
Comment #19
hass CreditAttribution: hass commentedInterresting... Why does it warn?
Comment #20
chertzogunexpected "." on the lines with the variables.
Comment #21
hass CreditAttribution: hass commentedThan i guess every drupal.setting.* must throw the same warning, isn't it?
Comment #22
chertzogWell, yes and no. They probably would, but Drupal.settings. has been changed to "drupalSettings"
See https://drupal.org/node/1793334
Comment #23
hass CreditAttribution: hass commentedBut setting var still has dots...
Comment #24
chertzogIm not sure. All i know is that with the "." chrome threw js errors. Without them, chrome was happy.
Doing a little more digging, it looks like initializing the Google_Analytics object, and then just setting its properties instead of creating new variables works just fine.
Comment #25
hass CreditAttribution: hass commentedNot against dev. Please refresh your clone.
I'd like to find out why drupal core can use dots in all function names...
Comment #26
hass CreditAttribution: hass commentedJavaScript settings moved from Drupal.settings to global drupalSettings variable
Commit: http://drupalcode.org/project/google_analytics.git/commit/7cd1eb7
Comment #27
hass CreditAttribution: hass commentedI guess I got it now. We could create the object like Drupal
var Google_Analytics = Google_Analytics || {};
on the very top, but I decided to reuse the Drupal namespace as I've seen locale module also does withDrupal.locale.*
and I guess it's allowed to jump into these Drupal namespace. This means all function names areDrupal.google_analytics.*
from now. I also changed all regexes into it's own functions for easier reuse. I believe this is cleaner and looks better. It may be a bit more code, but I don't care about this.This patch is completely untested and was only made code wise.
Comment #28
hass CreditAttribution: hass commentedComment #29
hass CreditAttribution: hass commentedCauses warnings
Comment #30
hass CreditAttribution: hass commentedWorked on the JS stuff and wrote a lot of tests and checked that everything really works as before. Have not found any issues yet.
Committed http://drupalcode.org/project/google_analytics.git/commit/1aa4a40
Comment #30.0
hass CreditAttribution: hass commenteda
Comment #30.1
hass CreditAttribution: hass commenteda
Comment #30.2
hass CreditAttribution: hass commenteda
Comment #30.3
hass CreditAttribution: hass commenteda
Comment #30.4
hass CreditAttribution: hass commenteda
Comment #30.5
hass CreditAttribution: hass commenteda
Comment #31
hass CreditAttribution: hass commentedComment #32
Crell CreditAttribution: Crell commentedComment #33
hass CreditAttribution: hass commentedComment #34
hass CreditAttribution: hass commentedComment #35
hass CreditAttribution: hass commentedComment #36
hass CreditAttribution: hass commentedComment #50
hass CreditAttribution: hass commentedComment #51
hass CreditAttribution: hass commentedThe remaining task seems not to happen in D8. Therefore closing now. However it's safe to say, D8 core may break the module again and we need to follow core than. But porting is done.
Comment #71
hass CreditAttribution: hass commented