From 932bf6e6ddd8eceb255fc9a256965fbe055a747d Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:19:37 +0200 Subject: [PATCH] fix(caldav): Add all selected columns to `GROUP BY` Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: code style Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/dav/lib/CalDAV/Reminder/Backend.php | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/apps/dav/lib/CalDAV/Reminder/Backend.php b/apps/dav/lib/CalDAV/Reminder/Backend.php index 1fa30f2538bdb..e50f3358e64fa 100644 --- a/apps/dav/lib/CalDAV/Reminder/Backend.php +++ b/apps/dav/lib/CalDAV/Reminder/Backend.php @@ -18,23 +18,10 @@ */ class Backend { - /** @var IDBConnection */ - protected $db; - - /** @var ITimeFactory */ - private $timeFactory; - - /** - * Backend constructor. - * - * @param IDBConnection $db - * @param ITimeFactory $timeFactory - */ - public function __construct(IDBConnection $db, - ITimeFactory $timeFactory) { - $this->db = $db; - $this->timeFactory = $timeFactory; - } + public function __construct( + protected IDBConnection $db, + private ITimeFactory $timeFactory + ) {} /** * Get all reminders with a notification date before now @@ -49,7 +36,7 @@ public function getRemindersToProcess():array { ->where($query->expr()->lte('cr.notification_date', $query->createNamedParameter($this->timeFactory->getTime()))) ->join('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id')) ->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id')) - ->groupBy('cr.event_hash', 'cr.notification_date', 'cr.type'); + ->groupBy('cr.id', 'cr.notification_date', 'cr.event_hash', 'cr.type', 'co.calendardata', 'c.displayname', 'c.principaluri'); $stmt = $query->execute(); return array_map(