Creating a user alias executes googleanalytics_token_values(), which produce the following messages:

warning: implode(): Invalid arguments passed in /sites/all/modules/google_analytics/googleanalytics.module on line 490.
warning: array_keys() expects parameter 1 to be array, null given in /sites/all/modules/google_analytics/googleanalytics.module on line 491.
warning: implode(): Invalid arguments passed in /sites/all/modules/google_analytics/googleanalytics.module on line 491.

A dsm($account); reveales:

uid (String, 1 characters ) 1
name (String, 12 characters ) admin
src (NULL)
dst (NULL)

I therefore surmise the issue to be that $account->roles doesn't exist, yet googleanalytics_token_values() explicitly assumes that it does.

CommentFileSizeAuthor
#3 ga_token_empty_roles.patch627 byteshass

Comments

hass’s picture

Status: Active » Postponed (maintainer needs more info)

Hell, i thought it has been fixed by http://drupal.org/node/1026892#comment-3962054 as it has been confirmed by the reporter that this works. Really bad. Can you say on what url you have seen this issue?

drupalgideon’s picture

I had this exact same problem today when I deleted all my user aliases as I wanted to use a different token for the path.

# warning: implode() [function.implode]: Invalid arguments passed in /sites/all/modules/contrib/google_analytics/googleanalytics.module on line 490.
# warning: array_keys() [function.array-keys]: The first argument should be an array in /sites/all/modules/contrib/google_analytics/googleanalytics.module on line 491.

This happened on /admin/build/path/pathauto so you need pathauto installed

To re-create bulk delete all user aliases from admin/build/path/delete_bulk

Then bulk generate user aliases from admin/build/path/pathauto

and the two warning errors occur for each user alias created.

hass’s picture

Version: 6.x-3.1 » 6.x-3.x-dev
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new627 bytes

Can you guys try this patch, please?

mustanggb’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected

drupalgideon’s picture

Yes I can confirm this is working for me too. Thanks for such a speedy response.

hass’s picture

Status: Reviewed & tested by the community » Fixed
hass’s picture

Title: googleanalytics_token_values() assumes "$account->roles" exists » Warning: Token hook assumes "$account->roles" exists

Status: Fixed » Closed (fixed)

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