Bug Trending content may cause unnecessary queries

There is a bug in this version
K

Kirby

Guest
XF\Repository\TrendingContentRepository::getResultContent always calls $handler->addAttachmentsToContent($content)

XF\TrendingContent\ThreadHandler
PHP:

Code:
public function getEntityWith(string $style): array
{
    $visitor = \XF::visitor();

    $with = [
        'Forum',
        'Forum.Node.Permissions|' . $visitor->permission_combination_id,
        'User',
    ];

    if (in_array($style, ['article', 'carousel'], true))
    {
        $with[] = 'FirstPost';
    }...

Read more

Continue reading...