Skip to content

Commit

Permalink
Merge pull request #327 from humhub/fix/326-cancelled-event-notificat…
Browse files Browse the repository at this point in the history
…ions

Don't send notifications for canceled events
  • Loading branch information
luke- authored Jul 26, 2022
2 parents 8e14404 + fa74b23 commit 210f813
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
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

0 comments on commit 210f813

Please sign in to comment.