From 20717d9c3d02fec5b0319c096e0b16cfd41e7d9a Mon Sep 17 00:00:00 2001 From: Tomasz Kryszan Date: Thu, 11 Apr 2024 10:07:00 +0200 Subject: [PATCH] Added order by limitation value to loadRole and loadRoleByIdentifier methods (#353) For more details see https://github.com/ibexa/core/pull/353 An `ORDER BY` clause for limitation values is needed to provide uniform (deterministic) limitation lookup response across all supported DBMS-es. --- .../Legacy/User/Role/Gateway/DoctrineDatabase.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php b/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php index 652aa02ab5..a6d535e3f3 100644 --- a/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php +++ b/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php @@ -157,7 +157,8 @@ public function loadRole(int $roleId, int $status = Role::STATUS_DEFINED): array $this->buildRoleDraftQueryConstraint($status, $query) ) ->orderBy('p.id', 'ASC') - ->addOrderBy('l.identifier', 'ASC'); + ->addOrderBy('l.identifier', 'ASC') + ->addOrderBy('v.value', 'ASC'); return $query->execute()->fetchAllAssociative(); } @@ -182,7 +183,8 @@ public function loadRoleByIdentifier( $this->buildRoleDraftQueryConstraint($status, $query) ) ->orderBy('p.id', 'ASC') - ->addOrderBy('l.identifier', 'ASC'); + ->addOrderBy('l.identifier', 'ASC') + ->addOrderBy('v.value', 'ASC'); return $query->execute()->fetchAllAssociative(); }