Ver Fonte

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

gedi há 13 anos atrás
pai
commit
ee158730d5
1 ficheiros alterados com 1 adições e 1 exclusões
  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);
     }
 
     /**