I recently found out that when you have the Google Analytics module activated the Theme Developer doesn't work anymore. Well nothing loads at all, I get a loading blank screen for ever. After disabling the module Theme Developer and my site do work again.
It's not very critical, but it may come in handy to know when you don't know why your site is broken after enabling theme developer and you just need it for development.

Comments

ajross’s picture

same problem - subscribing

Wouter Van den Bosch’s picture

Can confirm this issue.

Google Analytics version 6.x-1.2
Devel 6.x-1.x-dev (non dev version had the same issue)
Drupal 6.6

Getting a WSOD. First thought it was that Zend issue, but I'm not running it on my server. Stumbled upon this post, disabled Google Analytics (after getting my site back up and running by manually disabling devel in the system module and removing the folders from my drupal dir) and 'lo and behold, devel worked perfectly after a fresh install.

Will try to dig a little deeper tomorrow.

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

Let us know if theme developer an do anything to avoid this.

bookofchange’s picture

Yup. Having this same problem.

logicalpat’s picture

I can also confirm this issue with Drupal 6.6, Devel 6.x-1.12 and Google Analytics module 6.x-2.0.

hass’s picture

#349109: Conflict between Google Analytics and Theme Developer has been marked as duplicate of this issue and may have more information.

hass’s picture

Priority: Minor » Critical
Status: Postponed (maintainer needs more info) » Active

I think I have the source of this issue identified, but I have no idea how to fix and I'm not sure what and why this happens. Taking over the priority from the linked case.

This line in devel_themer.js wraps a SPAN around the body. When this happens the page seems to load again or loads GA.js - not sure - but we get a white page. You can also uncomment this line and the white pages isn't shown.

$('body').wrap('<span class="thmr_call" id="thmr_'+Drupal.settings.page_id+'"></span>');

I tried several ways to circumvent the wrap function, but was unsuccessful. All this also don't work + some others like append, prepend and so on:

$('body').wrapInner('<span class="thmr_call" id="thmr_'+Drupal.settings.page_id+'"></span>');
$('body').prependTo($('span').addClass("thmr_call").attr("id", Drupal.settings.page_id));

The only solution that seems to work for me was

$('body').addClass("thmr_call").attr("id", Drupal.settings.page_id);

But this may also require to change the line $('span.thmr_call') to $('body.thmr_call,span.thmr_call'). As this solution could potential overwrite a body ID - I'm not sure how we should ever solve this if the ID is a requirement.

Hopefully someone else have an idea with the now known source.

hass’s picture

Status: Active » Needs review
StatusFileSize
new810 bytes

Here is a patch for my variant... however I'm not sure if this is correct or if it breaks something.

hass’s picture

Title: Google analytics breaks Theme Developer » Page breaks if theme developer wraps body
Version: 6.x-1.9 » 6.x-1.x-dev
hass’s picture

hass’s picture

StatusFileSize
new1.04 KB

Updated patch.

seutje’s picture

Brigadier’s picture

This seems to affect the Piwik module as well, Piwik aims to do the same job as Google Analytics and uses similar methods. When Piwik is enabled and I use the "Enable Theme developer" link, I get the same behaviour described in this issue (endless loading, blank screen).

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

I've applied the patch in #11 and it fixed the issue. Any chance of getting this patch committed to Devel? Both devel and google analytics modules are great and it would be good to have them working together out of the box.

drewish’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

it'd need to go into the D7 version first and then be backported.

hass’s picture

Before this goes in I would really love to see someone who can explain why this wrapping crashes the site...

I have not understood why this happens and the patch was really a quick shoot workaround. I hope someone really understand the source of this issue and is able to share his knowledge... maybe it's better to remove all the wrapping and only adding the class to every element we are wrapping today... I have not build the theme developer and it's not so easy to understand how it should work, but that the theme developer is eating much memory and slows down page loading is a well known issue. Part of the slowness and very high memory usage could be the wrapping process. Not sure of there a way make this module performing much better with less memory, but I hope this is possible.

hass’s picture

bump

greenskunk’s picture

Thanks for the patch. Works great in D6!

giorgio79’s picture

Thanks had the same issue, namely ga.js was loading endlessly.

The patch fixed it for me.

Much appreciated hass

moshe weitzman’s picture

jjeff and I are having a mini sprint on Thursday and we plan to tackle this bug first.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

Committed a modified version of hass patch. Parent handling needed use hasClass to find page.tpl.php parent.

Andrew Schulman’s picture

Confirmed, this patch also fixes the problem for me. Thanks, Andrew.

hass’s picture

@moshe: Are you able to say when 6.x-6.16 is planned to be released? I'd like to remove this from the "known issues" on the Google Analytics project home asap.

Status: Fixed » Closed (fixed)

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

danny_joris’s picture

Status: Closed (fixed) » Active

I'm sorry to open this again, but i have an issue with this.

I have the latest Devel Installed (6.x-6.16) and the latest Google Analytics (6.x-2.2).

First i had the same issue of the blank screen as being the reason of this topic. I figured out that i still had Devel 6.x-6.14 so i changed it to 6.x-6.16. The problem of the blank screen is not solved (sometimes it is, and sometimes its not), and now i have a red error message at the very first page i open after i load the module page. I don't even need to change or save anything in the module page. Just load it and the next page i open will have the error. If i click away from that and back (or reload it), the message won't appear again. It looks like this:

* warning: preg_match() expects parameter 2 to be string, array given in /home/miekewil/public_html/drupal/modules/acquia/admin_menu/admin_menu.inc on line 244.
* warning: preg_match() expects parameter 2 to be string, array given in /home/miekewil/public_html/drupal/modules/acquia/admin_menu/admin_menu.inc on line 244.

moshe weitzman’s picture

Status: Active » Closed (duplicate)

Get latest of admin_menu module

danny_joris’s picture

I already have Administration Menu 6.x-1.3

danny_joris’s picture

Plus i can't upload pictures when Devel is enabled. When i uninstall it, all works fine...