From ad82721c3b164438d01ecc28350d8168894512a8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 29 Jan 2009 03:17:09 +0000 Subject: Fix an off-by-one issue-- the destination level is the target's child, not the target itself. --- core/libraries/ORM_MPTT.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php index 36065a69..4fa0a77a 100644 --- a/core/libraries/ORM_MPTT.php +++ b/core/libraries/ORM_MPTT.php @@ -222,7 +222,7 @@ class ORM_MPTT_Core extends ORM { $original_left = $this->left; $original_right = $this->right; $target_right = $target->right; - $level_delta = $target->level - $this->level; + $level_delta = ($target->level + 1) - $this->level; $this->lock(); try { -- cgit v1.2.3