I get the following error message, after creating an experiment and setting it live.

Fatal error: Call to undefined function drupal_get_path_alias() in /home/vintage/public_html/sites/all/modules/google_website_optimizer/google_website_optimizer.module on line 332

Wondering if this module works with the Google Analytics module?

CommentFileSizeAuthor
#4 init_crash_fix.patch3.57 KBDougKress

Comments

gav240z’s picture

I have managed to get Google Website Optimiser working on my site without this module.

I am using the user registration page to test which is under user/registration however in order to theme this page I need to use a theme_hook and some custom template.php code. So that might be why this module broke the website.

In fact I'm pretty sure the two are related.

Might be something worth looking at for other pages that can't easily be templated in Drupal.

Schoonzie’s picture

Status: Active » Closed (fixed)

I tried to reproduce this error by doing the following

I added this code to my template.php file

function phptemplate_user_register($form) {
return _phptemplate_callback('user_register', array('form' => $form));
}

and put some custom styling for the user register page in a file called user_register.tpl.php.

I then setup the Google Website Optimizer test to run on user/register and it worked without a problem.

I will close the issue now unless you can give me more detailed instructions on how to reproduce the error.

Thanks for trying out the module!

Nick

gav240z’s picture

I ended up not using the module as I found it easier to manually include the code. As I stated above I had to include a custom theme hook to be able to customise the user registration page in Drupal 5. I tried to use the module before implementing this hook, which is when I got the error.

If you try to use it on the user registration page eg: www.example.com/user/register without the theme hook it should break the site, well at least it did for me anyway.

Cheers,
Gavin.

DougKress’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new3.57 KB

I'm attaching a patch for this. The issue is that, at least in my version of Drupal, the 'drupal_get_path_alias()' function does not exist on a cached page for anonymous users during the hook_init() call.

I've moved the functionality formerly in hook_init into hook_menu in the !$may_cache section. This seems to work like a charm.

Additionally, the access rights issue is included with this patch (perm "administer google_website_optimizer" does not match user_access call with "administer google website optimizer").

- Doug

neochief’s picture

Status: Needs review » Fixed

Fixed in 5.x-1.2. I didn't used your patch, but just included path.inc and commons.inc in load function. Now everything works like a charm. Thanks for your help!

Status: Fixed » Closed (fixed)

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