Forum type filters not applied to API thread requests


Well-known member
Affected version
If you make an API call to read threads within a forum, the forum type handler filters don't get applied. So if you have a question forum and requested /api/forums/12/threads?solved=1 the filter isn't applied and all threads are returned.

I'm not sure if this is an intentional decision or a bug, but it only needs 2 lines to fix, within XF\Api\ControllerPlugin\Thread::applyThreadListFilters():

$filters = $forum->TypeHandler->getForumFilterInput($forum, $this->request, $filters);
$forum->TypeHandler->applyForumFilters($forum, $threadFinder, $filters);

I've had to extend this function to add these in so one of our addons works as expected, but I was surprised that it was necessary.
Top Bottom