From 6d64a41103fe0462e0a588922cb7e9fa350f2096 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 8 Apr 2024 16:18:56 -0300 Subject: [PATCH] fix: add pending group by JSON column with postgre need to be converted first to text to be possible use at group by Signed-off-by: Vitor Mattos --- lib/Db/SignRequestMapper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Db/SignRequestMapper.php b/lib/Db/SignRequestMapper.php index a4e05952fa..e97cb45708 100644 --- a/lib/Db/SignRequestMapper.php +++ b/lib/Db/SignRequestMapper.php @@ -24,6 +24,7 @@ namespace OCA\Libresign\Db; +use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use OCA\Libresign\Helper\Pagination; use OCA\Libresign\Service\IdentifyMethod\IIdentifyMethod; use OCA\Libresign\Service\IdentifyMethodService; @@ -464,6 +465,9 @@ private function getFilesAssociatedFilesWithMeQueryBuilder(string $userId, ?stri 'f.status', 'f.created_at', ); + if (!$qb->getConnection()->getDatabasePlatform() instanceof PostgreSQLPlatform) { + $qb->addGroupBy('f.metadata'); + } $or = [ $qb->expr()->eq('f.user_id', $qb->createNamedParameter($userId)),