Solved Adding additional relations for search forums requires ugly hack

This topic has been solved
K

Kirby

Guest
Under some conditions, we need to add further relations when loading threads for a search forum (to avoid n additional queries).

This could be accomplished by passing $extraWith to \XF\Entity\SearchForumUserCache::getThreadsByPage(), but unfortunately this method is called rather in the middle of \XF\Pub\Controller\SearchForum::actionView() with no obviois option to set this parameter.

PHP:

$threads = $userCache->getThreadsByPage($page, $perPage);

So short of...

Read more

Continue reading...