• Resolved Garrett Hyder

    (@garrett-eclipse)


    Hello,

    I just wanted to flag that I think in 3.0 that the avatar_size was introduced to the settings. I found in my logs for a while the following;
    Notice: Undefined index: avatar_size in …plugins/wd-twitter-feed/includes/Tweets/UI/Tweet/controller.php on line 28

    Which refers to this code;
    $this->avatar_size = $twitterfeed_settings['avatar_size'];

    When I disabled WP-Debug these messages started appearing in the feed itself;

    View post on imgur.com

    To resolve I found going to the settings and saving the tab showing the avatar size field resolved the issue.

    So it might be good to do a check in $twitterfeed_settings that array key exists and isn’t empty, and when it fails to set to a default value rather than error out as it does now.

    Seems to only affect you if you upgraded from a version prior to 3.0

    All the best,
    Cheers

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there, the avatar_size option was introduced in 2.1.6. Was your version older than that?

    Thread Starter Garrett Hyder

    (@garrett-eclipse)

    Hi @ykadosh, looking at our logs we updated from 2.1.12 to 3.0.2 but probably didn’t touch settings even before this so it may have been logging the error back from 2.1.6.

    Seems to be working now, just thought I’d suggest doing proper checking prior to using newly introduced settings. Something like this should suffice;
    if ( ! empty( $twitterfeed_settings ) && array_key_exists( 'avatar_size', $twitterfeed_settings ) && ! empty( $twitterfeed_settings['avatar_size'] ) )

    All the best,
    Cheers

    Yes that makes sense. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error Displayed – Undefined index: avatar_size’ is closed to new replies.