Closed (fixed)
Project:
Google Analytics
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2013 at 23:41 UTC
Updated:
31 May 2015 at 17:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
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 commented#1903586: Create Drupal8 Branch
Comment #4
hass commentedReopening this case as the title fits best and the case has a patch.
Comment #5
darrell_ulm commented#1: google_analytics-Drupal_8_upgrade-1948588.patch queued for re-testing.
Comment #6
hass commentedThis will fail...
Comment #7
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 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 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 commentedFixed variables in submitForm()
Comment #11
hass commentedCurrent_path(), http://drupal.org/node/1888424#comment-7283326
Comment #12
hass commentedSettings form works. Let's see how the tests are failing.
Comment #13
hass commentedUpgraded tests files, a few tests are failing.
Comment #14
hass commentedCommitted latest code for now to remove form patch issue.
http://drupalcode.org/project/google_analytics.git/commit/7f993f0
Comment #14.0
hass commentedA
Comment #14.1
hass commentedA
Comment #14.2
hass commentedA
Comment #15
hass commentedMoved
google_analytics.settings.last_cacheto 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 commenteda
Comment #15.1
hass commenteda
Comment #16
chertzogAttached is a patch which addresses a few small things i needed to get up and running.
Comment #17
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 commentedInterresting... Why does it warn?
Comment #20
chertzogunexpected "." on the lines with the variables.
Comment #21
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 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 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 commentedJavaScript settings moved from Drupal.settings to global drupalSettings variable
Commit: http://drupalcode.org/project/google_analytics.git/commit/7cd1eb7
Comment #27
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 commentedComment #29
hass commentedCauses warnings
Comment #30
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 commenteda
Comment #30.1
hass commenteda
Comment #30.2
hass commenteda
Comment #30.3
hass commenteda
Comment #30.4
hass commenteda
Comment #30.5
hass commenteda
Comment #31
hass commentedComment #32
Crell commentedComment #33
hass commentedComment #34
hass commentedComment #35
hass commentedComment #36
hass commentedComment #50
hass commentedComment #51
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 commented