In #1630044: Error when accessing a blog page such as .../blogs/username, me_handler() and the code in me_menu_alter() that sets up the router to pass arguments to me_handler() were refactored. While the "if" part of the conditional block in me_menu_alter() was rewritten to pass the arguments in the correct order for the refactored me_handler(), the "else" part was not. When Me and the core module Statistics are enabled, user/{uid}/track/navigation leads to a WSOD and the following warning:

call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members in /data/www/sites/all/modules/me/me.module on line 214

The problem being that $callback in me_handler is populated with array('user', '%me', 'track', 'navigation") instead of the correct 'statistics_user_tracker'. Likewise, $parts is populated with 'statistics_user_tracker' instead of the correct array('user', '%me', 'track', 'navigation").

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark Trapp’s picture

Status: Active » Needs review
FileSize
1.6 KB

Attached is a patch that fixes the order. I also rewrote the conditional in question to conform to Drupal's coding standards: it makes it very clear what the order should be and should help to mitigate regressions in the future.

Finally, an update function was added to rebuild the menu so the changes are reflected in the menu registry.

noah’s picture

Issue summary: View changes

This fix doesn't seem to have made it into the module -- I just had to apply it again (manually) after updating to 7.x.1-2 to fix a WSOD.

nohup’s picture

It never made it to the release because it never made it to the dev branch. The patch does fix the WSOD but when I access the track/navigation page I get a page not found. I will post a patch and commit this to dev once I find a solution.

BrianLP’s picture

Good to hear this, thank you. I just had the same encounter.

kardave’s picture

The patch worked for me, no 404 error on /user/1234/track/navigation

nohup’s picture

Status: Needs review » Fixed

The statistics module uses user_load(arg(1)) to load the user from the argument, which fails when me module is enabled. If user_load(arg(1)) is replaced with menu_get_object('user', 1) in the statistics module it fixes the problem. Patch applied to dev. Opening an issue for the statistics module.

  • nohup committed e38036c on 7.x-1.x authored by Mark Trapp
    Issue #2076691 by Mark Trapp: Arguments passed to me_handler() in the...
codesmith’s picture

Status: Fixed » Active

I'm getting this error and do not have the Statistics module enabled. The dev branch works for me.

codesmith’s picture

Status: Active » Fixed

Changing back to fixed as I guess I have a different issue since this one being reported is tied to Statistics and the patch did not make into dev.

Status: Fixed » Closed (fixed)

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