1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

perf: Temporary quick fix for tags state performance (#3117)

This commit is contained in:
Sami Mazouz
2021-10-21 21:56:12 +01:00
committed by GitHub
parent 99112429f9
commit 9c8dceff33

View File

@@ -125,6 +125,17 @@ class ListDiscussionsController extends AbstractListController
$results = $results->getResults();
/*
* @TODO replace in 1.2 with proper implementation!!!
*/
if (in_array('tags.state', $include, true)) {
$results->load([
'tags.state' => function ($query) use ($actor) {
$query->where('user_id', $actor->id);
}
]);
}
$this->loadRelations($results, $include);
if ($relations = array_intersect($include, ['firstPost', 'lastPost', 'mostRelevantPost'])) {