From 27a6f8020bfb2626e72ab012ab78420f33b4d8ef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 24 Jul 2019 10:39:22 +0200 Subject: [PATCH 1/2] Get the topmost parent for the parent instead of doing endless recursion Signed-off-by: Joas Schilling --- lib/private/Comments/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 309b682767..5b256c379b 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -159,7 +159,7 @@ class Manager implements ICommentsManager { if ($comment->getParentId() === '0') { return $comment->getId(); } else { - return $this->determineTopmostParentId($comment->getId()); + return $this->determineTopmostParentId($comment->getParentId()); } } From c7322c7efdcfadf31c34f00c47f4c42f3d196ed4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 24 Jul 2019 10:39:57 +0200 Subject: [PATCH 2/2] PHPStorm code cleanup Signed-off-by: Joas Schilling --- lib/private/Comments/Manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php index 5b256c379b..e54218509d 100644 --- a/lib/private/Comments/Manager.php +++ b/lib/private/Comments/Manager.php @@ -158,9 +158,9 @@ class Manager implements ICommentsManager { $comment = $this->get($id); if ($comment->getParentId() === '0') { return $comment->getId(); - } else { - return $this->determineTopmostParentId($comment->getParentId()); } + + return $this->determineTopmostParentId($comment->getParentId()); } /**