Confirmed Soft-deleting a profile post does not exclude comment reactions from user scores

Painbaker

Well-known member
Licensed customer
Affected version
2.3.13
Reactions to comments on soft-deleted profile posts remain counted toward their author reaction scores instead of being excluded

Suggested fix:

Diff:
--- a/src/XF/Reaction/ProfilePostCommentHandler.php
+++ b/src/XF/Reaction/ProfilePostCommentHandler.php
@@ -12,7 +12,12 @@
     public function reactionsCounted(Entity $entity)
     {
-        return ($entity->message_state == 'visible');
+        if (!$entity->ProfilePost)
+        {
+            return false;
+        }
+
+        return ($entity->message_state == 'visible'
+            && $entity->ProfilePost->message_state == 'visible');
     }
 
Back
Top Bottom