Fixed Forum type filters not applied to API thread requests

mattrogowski

Well-known member
Affected version
2.2.13
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():

PHP:
$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.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.14).

Change log:
Support filtering threads with forum type filters when using the API
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom