From fe9417dcfc42a58362aaf6d528d748d335e30cfb Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Sat, 16 Jul 2022 15:03:42 -0400 Subject: [PATCH] Minor update to CommentArray --- wire/modules/Fieldtype/FieldtypeComments/CommentArray.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wire/modules/Fieldtype/FieldtypeComments/CommentArray.php b/wire/modules/Fieldtype/FieldtypeComments/CommentArray.php index 45d3ee12..0667b464 100644 --- a/wire/modules/Fieldtype/FieldtypeComments/CommentArray.php +++ b/wire/modules/Fieldtype/FieldtypeComments/CommentArray.php @@ -260,7 +260,9 @@ class CommentArray extends PaginatedArray implements WirePaginatable { $count = 0; $stars = false; foreach($this as $comment) { + /** @var Comment $comment */ if(!$comment->stars) continue; + if($comment->status < Comment::statusApproved) continue; $total += $comment->stars; $count++; }