From a7d3853f43de6b8801b6c0c1d6b97f1648cfc259 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 11 Oct 2023 13:10:51 -0100 Subject: [PATCH] order by viewer level Signed-off-by: Maxence Lange --- lib/Db/CircleRequest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Db/CircleRequest.php b/lib/Db/CircleRequest.php index 02fa65389..01310c5a7 100644 --- a/lib/Db/CircleRequest.php +++ b/lib/Db/CircleRequest.php @@ -184,6 +184,7 @@ public function getCircles(?IFederatedUser $initiator, CircleProbe $probe): arra $qb->filterCircles(CoreQueryBuilder::CIRCLE, $probe); if (!is_null($initiator)) { $qb->limitToInitiator(CoreQueryBuilder::CIRCLE, $initiator); + $qb->orderBy($qb->generateAlias(CoreQueryBuilder::CIRCLE, CoreQueryBuilder::INITIATOR) . '.level', 'desc'); } if ($probe->hasFilterMember()) { $qb->limitToDirectMembership(CoreQueryBuilder::CIRCLE, $probe->getFilterMember());