After upgrading to version 1.5, I could no longer configure google analytics. Browsing to the URL http://example.com/admin/settings/googleanalytics gave the following error:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'googleanalytics_admin_settings' was given in /home/example/drupal-5.7/includes/form.inc on line 218.

I'm using Drupal 5.7.

Comments

hass’s picture

Status: Active » Postponed (maintainer needs more info)

From what version are you upgrading?
Have you run through /update.php?
Could you try to disable and re-enable the module? I haven't seen this while testing, but it sounds like a menu caching issue.

hass’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Fixed

You MUST run the drupal upgrade process and I'm pretty sure you haven't done this (reproduced with upgrade from 1.3 to 1.5).

hass’s picture

Title: Can't configure google analytics » Can't configure google analytics without running update.php
hass’s picture

Title: Can't configure google analytics without running update.php » Can't configure GA without running update.php
dshaw’s picture

Thanks for all the tips. Turns out disabling/reenabling the module solved my problems.

Note: I definitely did run update.php yesterday immediately after I upgraded so that wasn't the problem. I upgraded from V1.4. You may want to update the issue title to reflect this.

hass’s picture

I will do another test with 1.4. As I know the update.php flushes the menu cache... but I'm not 100% sure and if this won't happen I shouldn't be able to verify that it works after running update.php and not before!?

rhylos’s picture

FYI, I had the same problem after upgrading and using update.php
I watched the progress bar during the update as well as saw no error messages during the update. It did reflect the successful updates that it applied.

I'm using:
W2k3 Sp2
IIS6
PHP 5.2.6
Drupal 5.7
MySQL 5.0.51a
Updated GA 1.4 to 1.5

Thanks for all the tips to get this going again.

hass’s picture

Category: support » bug
Status: Fixed » Needs review

Removed code. update.php clear the caches on D6 and D5... i wonder what could be wrong here.

hass’s picture

Status: Needs review » Postponed (maintainer needs more info)
hass’s picture

I'm still not able to reproduce this. I'm using PHP 5.2.6, MySQL 5.0.51b, WinXP, IIS 5.1, Drupal 5.7.

0. Uninstalled 1.5
1. Installed 1.3 or 1.4
2. Configured UA-1234-5
2a. Put site in maintaince
3. Deleted google_anaytics folder
4. Extracted 1.5
5. Clicked on admin/settings/googleanalytics -> Fails -> Expected behavior
6. Called update.php, run all updates
7. Go to Administration section and admin/settings/googleanalytics
8. All ok.

If you are able to reproduce this, we could try to add a fix if there is a bug.

dshaw’s picture

The steps I performed were:

  1. web: Logged in as user 0
  2. cli: Removed GA 1.4 from sites/all/modules
  3. cli: Extracted GA 1.5 into sites/all/modules
  4. web: executed update.php - no errors noticed
  5. web: browsed to admin/logs/updates - confirmed at 1.5
  6. web: browsed to admin/settings/googleanalytics - error message encountered

So I performed fewer steps and didn't put the site into maintenance.

I was able to repeat this fairly easily. If I rolled back to 1.4 the settings URL would work. If I upgraded it wouldn't.

hass’s picture

What caching settings do you have?

Caching enabled/disabled?
Time to cache?
Webserver?
Drupal version?

Are you able to debug this issue?

esbite’s picture

I also had this problem and solved it by disabling and enabling the module.

When disabling, it gave me this error

warning: rmdir(files/googleanalytics) [function.rmdir]: No such file or directory in /_drupal_base_path_/sites/all/modules/google_analytics/googleanalytics.install on line 44.
hass’s picture

@thoughts: Is your error_reporting set to E_ALL & ~E_NOTICE? See http://drupal.org/requirements.

hass’s picture

Could someone try to add this to the end of googleanalytics.install v1.5 and try a upgrade from 1.4 or 1.3 to see if this fixes the problem? Please make sure you can reproduce the menu caching issue every time without the following code.

function googleanalytics_update_6003() {
  $ret = array();
  cache_clear_all();
  menu_rebuild();
  return $ret;
}
hass’s picture

Status: Postponed (maintainer needs more info) » Needs review
dshaw’s picture

I have "normal" caching enabled, with no minimum cache lifetime.

I'm using Drupal 5.7, Apache 2.0.x, PHP 5.2.x.

I also got the same error as Comment #13. Don't know if that helps.

hass’s picture

@dshaw: see #14

dshaw’s picture

Sorry, meant to report that to. From phpinfo()

error_reporting 6135, 6135 (i.e both master and local are 6135).

After searching php.net: E_ALL = 6143, E_NOTICE = 8
In hex: 0x17FF, 0x0008
0x17FF & ~0x0080 = 0x17F7
In Dec: 6135

So yes, it seems I have error reporting as E_ALL & ~E_NOTICE.

hass’s picture

If you see this "warning" (not an error) you do not have ~E_NOTICE configured or you have removed this from core code. D5 and D6 is not EALL save and this is only a minor EALL issue that could be fixed very easily.

Please focus on the menu caching issue.

hass’s picture

Status: Needs review » Fixed

Added code from #15 that hopefully fixes this issue.

dshaw’s picture

Today I upgraded five Drupal 5.7 sites to GA 1.6. Four went from 1.4->1.6, while the fifth went from 1.5->1.6. Four sites upgraded with no hitches. One site (going from 1.4->1.6) gave me the original error message when I first went to configure GA. Refreshing the page cleared the error and I was able to configure GA just fine. So things seems to have improved. And the fact that refreshing the page cleared the error, suggests caching was involved somehow.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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