From 61a05f6bc248c5c9161893fcf7cad5f9bdf134e6 Mon Sep 17 00:00:00 2001 From: PaulZi Date: Thu, 17 Sep 2015 17:51:23 +0300 Subject: [PATCH] Fix stupid bug in moveNode() --- NestedSetsBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NestedSetsBehavior.php b/NestedSetsBehavior.php index dc929e8..33fcb0b 100644 --- a/NestedSetsBehavior.php +++ b/NestedSetsBehavior.php @@ -555,8 +555,8 @@ class NestedSetsBehavior extends Behavior $this->shift($to, $left - 1, $delta); $delta = $to - $left; } else { - $this->shift($right + 1, $to, -$delta); - $delta = $to - $right; + $this->shift($right + 1, $to - 1, -$delta); + $delta = $to - $right - 1; } $this->owner->updateAll( [