浏览代码

[tree] shift after deletions are scheduled, references #265

gedi 13 年之前
父节点
当前提交
ee158730d5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/Gedmo/Tree/Strategy/ORM/Nested.php

+ 1 - 1
lib/Gedmo/Tree/Strategy/ORM/Nested.php

@@ -190,7 +190,6 @@ class Nested implements Strategy
         }
         $rootId = isset($config['root']) ? $wrapped->getPropertyValue($config['root']) : null;
         $diff = $rightValue - $leftValue + 1;
-        $this->shiftRL($em, $config['useObjectClass'], $rightValue + 1, -$diff, $rootId);
         if ($diff > 2) {
             $dql = "SELECT node FROM {$config['useObjectClass']} node";
             $dql .= " WHERE node.{$config['left']} BETWEEN :left AND :right";
@@ -206,6 +205,7 @@ class Nested implements Strategy
                 $uow->scheduleForDelete($removalNode);
             }
         }
+        $this->shiftRL($em, $config['useObjectClass'], $rightValue + 1, -$diff, $rootId);
     }
 
     /**