From 0ab1f2cfe7ec3438c4e37d2a11bb0fd17713b15f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 8 Feb 2018 07:08:39 +1030 Subject: [PATCH] Fix regression: set actor before eager loading user state --- src/Api/Controller/ListDiscussionsController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Api/Controller/ListDiscussionsController.php b/src/Api/Controller/ListDiscussionsController.php index c5b98a253..28a6e8bbc 100644 --- a/src/Api/Controller/ListDiscussionsController.php +++ b/src/Api/Controller/ListDiscussionsController.php @@ -12,6 +12,7 @@ namespace Flarum\Api\Controller; use Flarum\Api\Serializer\DiscussionSerializer; +use Flarum\Discussion\Discussion; use Flarum\Discussion\Search\DiscussionSearcher; use Flarum\Http\UrlGenerator; use Flarum\Search\SearchCriteria; @@ -93,6 +94,8 @@ class ListDiscussionsController extends AbstractListController $results->areMoreResults() ? null : 0 ); + Discussion::setStateUser($actor); + $results = $results->getResults()->load($load); if ($relations = array_intersect($load, ['startPost', 'lastPost'])) {