From 3f2d217a45e81c0501ca21fdef5f09d405fe3429 Mon Sep 17 00:00:00 2001 From: Mojmir Fendek Date: Wed, 5 Jul 2017 10:13:48 +1200 Subject: [PATCH] Limited nodes that have more children than allowed limit are no longer accessible to the user. --- src/ORM/Hierarchy/MarkedSet.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ORM/Hierarchy/MarkedSet.php b/src/ORM/Hierarchy/MarkedSet.php index 141e0eca6..353b11cf8 100644 --- a/src/ORM/Hierarchy/MarkedSet.php +++ b/src/ORM/Hierarchy/MarkedSet.php @@ -407,13 +407,14 @@ class MarkedSet // Build root rode $expanded = $this->isExpanded($node); $opened = $this->isTreeOpened($node); + $count = ($limited && $numChildren > $this->getMaxChildNodes()) ? 0 : $numChildren; $output = [ 'node' => $node, 'marked' => $this->isMarked($node), 'expanded' => $expanded, 'opened' => $opened, 'depth' => $depth, - 'count' => $numChildren, // Count of DB children + 'count' => $count, // Count of DB children 'limited' => $limited, // Flag whether 'items' has been limited 'children' => [], // Children to return in this request ];