ソースを参照

[tree] persist as sibling fix, references #208

gedi 13 年 前
コミット
5c2c2302db
1 ファイル変更4 行追加8 行削除
  1. 4 8
      lib/Gedmo/Tree/Strategy/ORM/Nested.php

+ 4 - 8
lib/Gedmo/Tree/Strategy/ORM/Nested.php

@@ -287,19 +287,15 @@ class Nested implements Strategy
             switch ($position) {
                 case self::PREV_SIBLING:
                     $newParent = $wrappedParent->getPropertyValue($config['parent']);
-                    if (!$isNewNode) {
-                        $wrapped->setPropertyValue($config['parent'], $newParent);
-                        $em->getUnitOfWork()->recomputeSingleEntityChangeSet($meta, $node);
-                    }
+                    $wrapped->setPropertyValue($config['parent'], $newParent);
+                    $em->getUnitOfWork()->recomputeSingleEntityChangeSet($meta, $node);
                     $start = $parentLeft;
                     break;
 
                 case self::NEXT_SIBLING:
                     $newParent = $wrappedParent->getPropertyValue($config['parent']);
-                    if (!$isNewNode) {
-                        $wrapped->setPropertyValue($config['parent'], $newParent);
-                        $em->getUnitOfWork()->recomputeSingleEntityChangeSet($meta, $node);
-                    }
+                    $wrapped->setPropertyValue($config['parent'], $newParent);
+                    $em->getUnitOfWork()->recomputeSingleEntityChangeSet($meta, $node);
                     $start = $parentRight + 1;
                     break;