From 4ee1b5df5bbd9f69384f248a29715397248b397e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B4me=20Bakker?= Date: Mon, 26 Sep 2022 12:00:51 +0200 Subject: [PATCH] fixed: deadloop during sending of GroupMail --- classes/GroupMail.php | 4 ++-- elgg-plugin.php | 2 +- languages/en.php | 1 + languages/nl.php | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/GroupMail.php b/classes/GroupMail.php index 93bb071f..5e26fe9b 100644 --- a/classes/GroupMail.php +++ b/classes/GroupMail.php @@ -21,7 +21,7 @@ protected function initializeAttributes() { * @return string */ public function getSubject() { - return $this->title; + return $this->title ?? elgg_echo('group_tools:mail:message:default_subject', [$this->getContainerEntity()->getDisplayName()]); } /** @@ -95,7 +95,7 @@ public function enqueue() { return false; } - elgg_trigger_event('enqueue', 'object', $this); + elgg_trigger_event('enqueue-mail', 'object', $this); return true; } diff --git a/elgg-plugin.php b/elgg-plugin.php index bfc4244f..be1755d2 100644 --- a/elgg-plugin.php +++ b/elgg-plugin.php @@ -295,7 +295,7 @@ ], 'object' => [ 'group_tools_group_mail' => [ - 'enqueue' => GroupMailEnqueueNotificationEventHandler::class, + 'enqueue-mail' => GroupMailEnqueueNotificationEventHandler::class, ], ] ], diff --git a/languages/en.php b/languages/en.php index 9c942cfc..946f8e09 100644 --- a/languages/en.php +++ b/languages/en.php @@ -352,6 +352,7 @@ 'groups:tool:mail_members' => "Allow group members to mail other group members", 'groups:tool:mail_members:description' => "This will allow normal group members to send an e-mail to other group members. By default this is limited to group admins.", + 'group_tools:mail:message:default_subject' => "Notification from the group %s", 'group_tools:mail:message:from' => "From group", 'group_tools:mail:title' => "Send a mail to the group members", diff --git a/languages/nl.php b/languages/nl.php index 31638d4e..4de60e05 100644 --- a/languages/nl.php +++ b/languages/nl.php @@ -1,10 +1,11 @@ 'Bericht uit de groep %s', 'groups:tool:group_multiple_admin_allow:description' => 'Laat groepsbeheerders andere groepsbeheerders beheren. Normaal kan alleen de groepseigenaar dit beheren.', 'groups:tool:related_groups:description' => 'Toon een lijst met gerelateerde groepen aan de leden van deze groep.', 'group_tools:welcome_message:notifications' => 'Activiteiten binnen deze groep kunnen notificaties versturen.