Hey everyone,

When using the "Masquerade as Anonymous" link found in the Navigation menu block, I'm getting the following error message:

Notice: Undefined property: stdClass::$name in masquerade_block_1() (line 418 of /home/sandboxes/sandbox10/public_html/sites/all/modules/contrib/masquerade/masquerade.module).

The error message persists on all site pages while I'm masquerading as an anonymous user. Any ideas as to the cause and how to fix?

--Ben

Comments

BenK’s picture

Title: Perisistent Error Message When Using "Masquerade as Anonymous" Link » D7: Perisistent Error Message When Using "Masquerade as Anonymous" Link
deekayen’s picture

Status: Active » Closed (duplicate)

Just guessing, but I bet porting this other patch will fix it.
#822098: use theme_username() in messages to users

mikedotexe’s picture

Issue summary: View changes

We've noticed this as well. It seems like masquerade will run through the call (at least in our case) a few times. So it was safe to say

if (!property_exists($user, 'name')) return;

This may not work in all cases, but ironed it out for us.