Fixed XenForo_Model_Thread::FETCH_AVATAR bug

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)';
}
 
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.
 
Top Bottom