From 79337bd36ebcb3939c99b58e123c1a51d04755aa Mon Sep 17 00:00:00 2001 From: Gordon Anderson Date: Fri, 13 Feb 2015 18:36:14 +0700 Subject: [PATCH] FIX: ID being used to check for children was incorrect --- code/controllers/CommentingController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/CommentingController.php b/code/controllers/CommentingController.php index 1b2ea01..c2a833c 100644 --- a/code/controllers/CommentingController.php +++ b/code/controllers/CommentingController.php @@ -136,7 +136,7 @@ class CommentingController extends Controller { } if(($comment = $this->getComment()) && $comment->canDelete()) { - $childcount = Comment::get()->filter('ParentCommentID', $this->ID)->count(); + $childcount = Comment::get()->filter('ParentCommentID', $comment->ID)->count(); if ($childcount == 0) { $comment->delete(); } else {