소스 검색

[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);
     }
 
     /**