The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[Plugin: Add Local Avatar] Notice: Undefined property (2 posts)

  1. Justin01
    Posted 7 years ago #


    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: http://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.


  2. peterwsterling
    Posted 7 years ago #

    Please see previous comment.

Topic Closed

This topic has been closed to new replies.

About this Topic