• 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

xfrocks

Well-known member
#1
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

XenForo moderator
Staff member
#3
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.