[Plugin: Add Local Avatar] Notice: Undefined property
-
Hi,
I don’t know if my question will be answered, since the last one I posted wasn’t. I’ll still give it a shot.
Almost everything is working fine, except that the plugin seems to be shooting a PHP error when a member posts a comment in the comment section:
Notice: Undefined property: stdClass::$first_name in /home/......./avatars.php on line 120 Notice: Undefined property: stdClass::$last_name in /home/......./avatars.php on line 120
Here’s line 120:
$name = ($avatar_options[‘name’] == ‘on’ ? $user->nickname : $user->first_name . ‘ ‘ . $user->last_name);
This plugin shoots a lot of errors, but I’ve managed to fix them by Googling. But, in this case, Google didn’t help.
UPDATE: I’ve noticed that it was due to the fact that the member didn’t have a first and last name assigned to their profile. How can I bypass this?
UPDATE 2: User seems to have the same error: https://aftershockproject.com/artists/aftershock-project/
UPDATE 3: Looks like it’s for the anchor title attribute. Doesn’t seem too much important.
UPDATE 4: Changed the line to:
$name = ($avatar_options[‘name’] == ‘on’ ? $user->nickname : ‘Avatar’);
Thanks a lot for your time.
Justin
- The topic ‘[Plugin: Add Local Avatar] Notice: Undefined property’ is closed to new replies.