Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send notifications for canceled events #327

Merged
merged 3 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion models/forms/CalendarEntryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion models/forms/CalendarEntryParticipationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
8 changes: 8 additions & 0 deletions models/reminder/ReminderProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private function runByUpcomingEvents(ContentContainerActiveRecord $container = n
continue;
}

if ($entry->closed) {
continue;
}

$skipUsers = $this->handleEntryLevelReminder($entry);

if($skipUsers === true) {
Expand Down Expand Up @@ -114,6 +118,10 @@ private function runEntryLevelOnly()
continue;
}

if ($entry->closed) {
continue;
}

$entryKey = get_class($entry).':'.$entry->id;
if(!isset($entryHandled[$entryKey])) {
$this->handleEntryLevelReminder($entry);
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down