Fix regression: set actor before eager loading user state

This commit is contained in:
Toby Zerner 2018-02-08 07:08:39 +10:30
parent 322a84f516
commit 0ab1f2cfe7

View File

@ -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'])) {