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")
.
Comment | File | Size | Author |
---|---|---|---|
#1 | me-fix_argument_order-2076691-1.patch | 1.6 KB | Mark Trapp |
Comments
Comment #1
Mark TrappAttached 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.
Comment #2
noah CreditAttribution: noah commentedThis 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.
Comment #3
nohup CreditAttribution: nohup commentedIt 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.
Comment #4
BrianLP CreditAttribution: BrianLP commentedGood to hear this, thank you. I just had the same encounter.
Comment #5
kardave CreditAttribution: kardave commentedThe patch worked for me, no 404 error on /user/1234/track/navigation
Comment #6
nohup CreditAttribution: nohup commentedThe statistics module uses
user_load(arg(1))
to load the user from the argument, which fails when me module is enabled. Ifuser_load(arg(1))
is replaced withmenu_get_object('user', 1)
in the statistics module it fixes the problem. Patch applied to dev. Opening an issue for the statistics module.Comment #8
codesmithI'm getting this error and do not have the Statistics module enabled. The dev branch works for me.
Comment #9
codesmithChanging 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.