1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed XenForo_Model_Thread::FETCH_AVATAR bug

Discussion in 'Resolved Bug Reports' started by xfrocks, Sep 12, 2012.

  1. xfrocks

    xfrocks Well-Known Member

    This is a minor bug.

    File: xenforo/library/XenForo/Model/Thread.php
    Line: 131

    PHP:
    else if ($fetchOptions['join'] & self::FETCH_AVATAR)
    {
    $selectFields .= ',
    user.avatar_date, user.gravatar'
    ;
    $joinTables .= '
    LEFT JOIN xf_user AS user ON
    (user.user_id = thread.user_id)'
    ;
    }
    The $selectFields should include user gender to display the no-avatar image correctly. So, that code snippet should be

    PHP:
    else if ($fetchOptions['join'] & self::FETCH_AVATAR)
    {
    $selectFields .= ',
    user.gender, user.avatar_date, user.gravatar'
    ;
    $joinTables .= '
    LEFT JOIN xf_user AS user ON
    (user.user_id = thread.user_id)'
    ;
    }
     
    Jake Bunce and erich37 like this.
  2. erich37

    erich37 Well-Known Member

  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes indeed.

    At first I thought... wait a minute, the thread list doesn't have this problem. But I see that the thread list uses FETCH_USER not FETCH_AVATAR.
     
    erich37 likes this.
  4. Mike

    Mike XenForo Developer Staff Member

    Good catch, fixed.
     
    erich37, Slavik and xfrocks like this.

Share This Page