Skip to content

Commit 05bf5c3

Browse files
committed
BUG: Bad notification process without recipients
1 parent 78c1d6b commit 05bf5c3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Controllers/NotificationsController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function newComment(Comment $comment, $request)
193193
$a_recipients = isset($comment->a_recipients) ? $comment->a_recipients : ($comment->type == 'note' ? $request->note_recipients : $request->reply_recipients);
194194
}
195195

196-
if (count($a_recipients) > 0){
196+
if ($a_recipients and count($a_recipients) > 0){
197197
if ($request->input('add_in_user_notification_text') != "" or (isset($comment->add_in_user_notification_text))){
198198
// Element in request comes from Comment modal
199199
// $comment property comes from an embedded comment when editing or creating a ticket
@@ -202,10 +202,10 @@ public function newComment(Comment $comment, $request)
202202
}
203203
}
204204

205-
if (count($a_recipients) > 0){
205+
if ($a_recipients and count($a_recipients) > 0){
206206
foreach($a_recipients as $member_id){
207207
$recipient = Member::find($member_id);
208-
if (count($recipient) == 1){
208+
if (!is_null($recipient)){
209209
// Register the notified email
210210
$notification = CommentNotification::create([
211211
'comment_id' => $comment->id,

0 commit comments

Comments
 (0)