When I add any kind of content it shows me this on that page !

Notice: Trying to get property of non-object in googleanalytics_page_alter() (line 167 of /var/www/drupal.flossk.org/sites/all/modules/google_analytics/googleanalytics.module).
Notice: Trying to get property of non-object in googleanalytics_page_alter() (line 167 of /var/www/drupal.flossk.org/sites/all/modules/google_analytics/googleanalytics.module).
Notice: Undefined index: in googleanalytics_page_alter() (line 167 of /var/www/drupal.flossk.org/sites/all/modules/google_analytics/googleanalytics.module).

CommentFileSizeAuthor
#8 googleanalytics-1199032-8.patch982 bytesboobaa

Comments

hass’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (cannot reproduce)

Try disabling other modules/theme one by one, one must have a major bug, but not GA.

Panthrax’s picture

Title: Error when adding content » Error when adding/viewing content
Category: support » bug
Status: Closed (cannot reproduce) » Active

The messages dissapear when the core module Content translation is deactivated again.

hass’s picture

Status: Active » Closed (duplicate)

Duplicate of #1173778: E_ALL: Node object could be empty? Before posting new issues try dev...

wvlgen’s picture

I have the same problem, but only with Internet Explorer.

When I switch off "Content Translation", I get other messages:

•Notice: Undefined index: access in _menu_translate() (line 778 of /home/rab/public_html/includes/menu.inc).
•Notice: Undefined index: access in menu_local_tasks() (line 1892 of /home/rab/public_html/includes/menu.inc).

and this with Internet Explorer and Firefox. I didn't try the other browsers.

Regards

wvlgen’s picture

It seems to me that you get the error only in IE --AND-- for pages set to "language neutral" in an multilanguage environment.

boran’s picture

Here is one fix, to stop a warning:
I found it before I read this issue or tried dev, sorry. But am noting it here it case it might help others.

diff --git a/sites/all/modules/google_analytics/googleanalytics.module b/sites/all/modules/google_analytics/googleanalytics.module
index 918135f..af56e3a 100644
--- a/sites/all/modules/google_analytics/googleanalytics.module
+++ b/sites/all/modules/google_analytics/googleanalytics.module
@@ -161,7 +161,7 @@ function googleanalytics_page_alter(&$page) {
       // Check we have a node object, it supports translation, and its
       // translated node ID (tnid) doesn't match its own node ID.
       $node = menu_get_object();
-      if ($node && translation_supported_type($node->type) && isset($node->tnid) && ($node->tnid != $node->nid)) {
+      if ($node && translation_supported_type($node->type) && isset($node->tnid) && ($node->tnid>0) && ($node->tnid != $node->nid)) {
         $source_node = node_load($node->tnid);
         $languages = language_list();
         $url_custom = drupal_json_encode(url('node/' . $source_node->nid, array('language' => $languages[$source_node->language])));
wvlgen’s picture

Assigned: altinukshini » wvlgen

With version 7.x-1.2 I have this problem also under Firefox:

Notice: Trying to get property of non-object in googleanalytics_page_alter() (line 167 of /home/rab/public_html/sites/all/modules/google_analytics/googleanalytics.module).
Notice: Trying to get property of non-object in googleanalytics_page_alter() (line 167 of /home/rab/public_html/sites/all/modules/google_analytics/googleanalytics.module).
Notice: Undefined index: in googleanalytics_page_alter() (line 167 of /home/rab/public_html/sites/all/modules/google_analytics/googleanalytics.module).

For the first language (before the other languages are being translated and the menu's are being built.These messages should be when a site is being translated and is not finished.

Regards

boobaa’s picture

StatusFileSize
new982 bytes

For those poor souls who happen to stick with latest supported stable version (7.x-1.2 for the time being) and do want to run multilanguage sites with some content only available in one of languages, attached is the patch that seems to be solve this issue. (Backported from -dev, though, where it's already fixed since I-don't-know-when.)