From 3ad5b322e8bd8417555748241dc9341ca47af17b Mon Sep 17 00:00:00 2001 From: Yura Bakhtin Date: Mon, 25 Jul 2022 14:42:20 +0300 Subject: [PATCH 1/3] Don't send notifications for canceled events --- models/forms/CalendarEntryForm.php | 2 +- models/forms/CalendarEntryParticipationForm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/forms/CalendarEntryForm.php b/models/forms/CalendarEntryForm.php index b625666a..c6c6f808 100644 --- a/models/forms/CalendarEntryForm.php +++ b/models/forms/CalendarEntryForm.php @@ -467,7 +467,7 @@ public function save() Topic::attach($this->entry->content, $this->topics); - if ($this->sendUpdateNotification && !$this->entry->isNewRecord) { + if ($this->sendUpdateNotification && !$this->entry->isNewRecord && !$this->entry->closed) { $this->entry->participation->sendUpdateNotification(); } diff --git a/models/forms/CalendarEntryParticipationForm.php b/models/forms/CalendarEntryParticipationForm.php index 10aa9776..ff9994eb 100644 --- a/models/forms/CalendarEntryParticipationForm.php +++ b/models/forms/CalendarEntryParticipationForm.php @@ -124,7 +124,7 @@ public function save() RichText::postProcess($this->entry->participant_info, $this->entry); } - if ($this->sendUpdateNotification && !$this->entry->isNewRecord) { + if ($this->sendUpdateNotification && !$this->entry->isNewRecord && !$this->entry->closed) { $this->entry->participation->sendUpdateNotification(); } From a761849168d052e0724708e4c1f9457d4407e4a9 Mon Sep 17 00:00:00 2001 From: Yura Bakhtin Date: Mon, 25 Jul 2022 17:13:26 +0300 Subject: [PATCH 2/3] Don't send notifications for canceled events --- models/reminder/ReminderProcessor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/reminder/ReminderProcessor.php b/models/reminder/ReminderProcessor.php index 6a5f1739..0a498ab8 100644 --- a/models/reminder/ReminderProcessor.php +++ b/models/reminder/ReminderProcessor.php @@ -86,6 +86,10 @@ private function runByUpcomingEvents(ContentContainerActiveRecord $container = n continue; } + if ($entry->closed) { + continue; + } + $skipUsers = $this->handleEntryLevelReminder($entry); if($skipUsers === true) { From fa74b23cce9e30a9d8114420abaab6efb8cee79b Mon Sep 17 00:00:00 2001 From: Yura Bakhtin Date: Mon, 25 Jul 2022 18:04:23 +0300 Subject: [PATCH 3/3] Don't send notifications for canceled events --- docs/CHANGELOG.md | 5 +++++ models/reminder/ReminderProcessor.php | 4 ++++ module.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d8695547..8968f024 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +1.2.6 (Unreleased) +-------------------- +- Fix #327: Don't send notifications for canceled event + + 1.2.5 (July 15, 2022) -------------------- - Fix #315: Fix participants list settings visibility diff --git a/models/reminder/ReminderProcessor.php b/models/reminder/ReminderProcessor.php index 0a498ab8..d6124d26 100644 --- a/models/reminder/ReminderProcessor.php +++ b/models/reminder/ReminderProcessor.php @@ -118,6 +118,10 @@ private function runEntryLevelOnly() continue; } + if ($entry->closed) { + continue; + } + $entryKey = get_class($entry).':'.$entry->id; if(!isset($entryHandled[$entryKey])) { $this->handleEntryLevelReminder($entry); diff --git a/module.json b/module.json index e54547f7..bf0bd7a3 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "Calendar", "description": "Calendar for spaces or user profiles.", "keywords": ["calendar"], - "version": "1.2.5", + "version": "1.2.6", "humhub": { "minVersion": "1.10" },