Hi.
After an upgrade from D6 to D7 I'm having a strange problem.
Log reports :
Trying to get property of non-object in masquerade_menu_access(); For every single page.

So far every functionnality of the module just appear to work nicely.
I tryed to debug a bit the problem and found that an uid that is not existing anymore in the system (109 - deletted user) is being passed to the fonction masquerade_menu_access($type, $uid = NULL).
so that masquerade_menu_access('switch', 109);

As consequence, when $account = user_load($uid); comes
$account stays undefined and then when $account->uid; arrives
then the bug occurs.

For sure adding the line :
if (!$account){
return FALSE;
}

fixed the problem... But I didn't managed to find why this wrong uid was passed to the function ?
And why this function is called at every single page calls. Isn't it supposed to work only at user switch ?
Any hints are greatly appreciated.

Thanks.

Comments

andypost’s picture

Status: Active » Fixed

Commited a bit different fix

andypost’s picture

And the same for 6.x branch - commit

Status: Fixed » Closed (fixed)

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

  • Commit 9b51e6d on 7.x-1.x, 8.x-2.x, 8.x-2.x-admin-menu, 8.x-1.x-1836516 by andypost:
    Issue #1632376 by andypost: fixed menu access notice
    
    

  • Commit 9b51e6d on 7.x-1.x, 8.x-2.x, 8.x-2.x-admin-menu, 8.x-1.x-1836516 by andypost:
    Issue #1632376 by andypost: fixed menu access notice