Problem/Motivation

We need a Drupal 8 version for the module.

Proposed resolution

Help porting and fixing the remaining Drupal core bugs.

Remaining tasks

Resolved tasks

User interface changes

None.

API changes

Unclear.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darrell_ulm’s picture

Status: Active » Needs review
FileSize
2.59 KB

Here 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:

--author="darrellulm <darrellulm@46284.no-reply.drupal.org>"

Learn more about proper Git attribution.

Hey-thank you!

Status: Needs review » Needs work

The last submitted patch, google_analytics-Drupal_8_upgrade-1948588.patch, failed testing.

hass’s picture

Status: Needs work » Closed (duplicate)
hass’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Category: feature » task
Status: Closed (duplicate) » Needs work

Reopening this case as the title fits best and the case has a patch.

darrell_ulm’s picture

Status: Needs work » Needs review
hass’s picture

This will fail...

darrell_ulm’s picture

And...you are correct.

I'll take a look at updating it later when I get a chance, or someone else can.

Cheers,

hass’s picture

Status: Needs review » Needs work
FileSize
43.07 KB

Work in process, does not contain changes from #1 and produces

Error message

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "drupal\google_analytics\google_analyticssettingsform". in Symfony\Component\DependencyInjection\Container->get() (line 279 of core\vendor\symfony\dependency-injection\Symfony\Component\DependencyInjection\Container.php).
The website has encountered an error. Please try again later.

No idea what's wrong, just sharing my latest code. Ideas welcome!

hass’s picture

FileSize
137.03 KB

Latest 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.

hass’s picture

FileSize
137.05 KB

Fixed variables in submitForm()

hass’s picture

hass’s picture

Status: Needs work » Needs review
FileSize
164.11 KB

Settings form works. Let's see how the tests are failing.

hass’s picture

FileSize
155.05 KB

Upgraded tests files, a few tests are failing.

hass’s picture

Status: Needs review » Needs work

Committed latest code for now to remove form patch issue.

http://drupalcode.org/project/google_analytics.git/commit/7f993f0

hass’s picture

Issue summary: View changes

A

hass’s picture

Issue summary: View changes

A

hass’s picture

Issue summary: View changes

A

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

chertzog’s picture

Status: Needs work » Needs review
FileSize
6.94 KB

Attached is a patch which addresses a few small things i needed to get up and running.

hass’s picture

Status: Needs review » Needs work

This is not against latest DEV and seems to contain a lot of unnecessary changes.

chertzog’s picture

the js variable name changes were because in chrome the Google_Analytics.* variables throw warnings.

hass’s picture

Interresting... Why does it warn?

chertzog’s picture

unexpected "." on the lines with the variables.

hass’s picture

Than i guess every drupal.setting.* must throw the same warning, isn't it?

chertzog’s picture

Well, yes and no. They probably would, but Drupal.settings. has been changed to "drupalSettings"

See https://drupal.org/node/1793334

hass’s picture

But setting var still has dots...

chertzog’s picture

Status: Needs work » Needs review
FileSize
5.94 KB

Im 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.

hass’s picture

Status: Needs review » Needs work

Not against dev. Please refresh your clone.

I'd like to find out why drupal core can use dots in all function names...

hass’s picture

JavaScript settings moved from Drupal.settings to global drupalSettings variable
Commit: http://drupalcode.org/project/google_analytics.git/commit/7cd1eb7

hass’s picture

I 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 with Drupal.locale.* and I guess it's allowed to jump into these Drupal namespace. This means all function names are Drupal.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.

hass’s picture

Status: Needs work » Needs review
hass’s picture

Status: Needs review » Needs work

Causes warnings

hass’s picture

Worked 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

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes

a

hass’s picture

Issue summary: View changes
Crell’s picture

hass’s picture

Title: Drupal 8 upgrade » Google Analytics 8 upgrade
Issue summary: View changes
hass’s picture

Issue summary: View changes
hass’s picture

Issue summary: View changes
hass’s picture

Issue summary: View changes

  • Commit 9b353a9 on 8.x-2.x by hass:
    Issue #1948588: per CHX (#2125745 comment #25) the 'drupalX_variable'...

  • Commit 980b1ef on 8.x-2.x by hass:
    Issue #1948588: Upgraded form_set_error() to
    \Drupal::formBuilder()->...

  • Commit 69b23e7 on 8.x-2.x by hass:
    Issue #1948588: Undefined index: linkid in
    Drupal\google_analytics\...

  • Commit 84c21a9 on 8.x-2.x by hass:
    Issue #1948588: Replace hook_menu_link_defaults() with
    modulename....

  • Commit 6692a30 on 8.x-2.x by hass:
    Issue #1948588: Move google_analytics.settings.yml to "config/install"...

  • Commit d8cf63e on 8.x-2.x by hass:
    Issue #1948588: drupal_load() is no longer available.
    

  • Commit 2f092ec on 8.x-2.x by hass:
    Issue #1948588: Move migrate.*.yml files to "config/install" folder
    

  • Commit a6dfa5b on 8.x-2.x by hass:
    Issue #1948588: \Drupal::httpClient() no longer requires "->send()"
    

  • Commit 5ec1b63 on 8.x-2.x by hass:
    Issue #1948588: Enable system internal page cache for DNT tests
    

  • Commit 96f32fa on 8.x-2.x by hass:
    Issue #1948588: Use internal page cache variable
    

  • Commit 7120f61 on 8.x-2.x by hass:
    Issue #1948588: Migrate PSR-0 to PSR-4
    

  • Commit bba4151 on 8.x-2.x by hass:
    Issue #1948588: Updated all Google documenation links
    

  • Commit c1dc8a1 on 7.x-2.x by hass:
    Issue #1948588: Updated all Google documenation links
    
hass’s picture

Issue summary: View changes
hass’s picture

Status: Needs work » Fixed

The 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.

Status: Fixed » Closed (fixed)

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

The last submitted patch, 8: ga+D8+upgrade.patch, failed testing.

The last submitted patch, 8: ga+D8+upgrade.patch, failed testing.

The last submitted patch, 1: google_analytics-Drupal_8_upgrade-1948588.patch, failed testing.

The last submitted patch, 1: google_analytics-Drupal_8_upgrade-1948588.patch, failed testing.

The last submitted patch, 9: ga+D8+upgrade2.patch, failed testing.

The last submitted patch, 9: ga+D8+upgrade2.patch, failed testing.

The last submitted patch, 10: ga+D8+upgrade2.patch, failed testing.

The last submitted patch, 10: ga+D8+upgrade2.patch, failed testing.

The last submitted patch, 12: ga+D8+upgrade3.patch, failed testing.

The last submitted patch, 12: ga+D8+upgrade3.patch, failed testing.

The last submitted patch, 13: ga+D8+upgrade4.patch, failed testing.

The last submitted patch, 13: ga+D8+upgrade4.patch, failed testing.

The last submitted patch, 16: ga-d8.patch, failed testing.

The last submitted patch, 16: ga-d8.patch, failed testing.

The last submitted patch, 24: ga-d8-24.patch, failed testing.

The last submitted patch, 24: ga-d8-24.patch, failed testing.

Status: Closed (fixed) » Needs work

The last submitted patch, 27: Integrate-with-Drupal-javascript-object-and-change-a.patch, failed testing.

The last submitted patch, 27: Integrate-with-Drupal-javascript-object-and-change-a.patch, failed testing.

hass’s picture

Status: Needs work » Closed (fixed)