Browse Source

Ensure parent is initialized before node update

craig 12 năm trước cách đây
mục cha
commit
eaccdb2c95
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      lib/Gedmo/Tree/Strategy/AbstractMaterializedPath.php

+ 3 - 0
lib/Gedmo/Tree/Strategy/AbstractMaterializedPath.php

@@ -273,6 +273,9 @@ abstract class AbstractMaterializedPath implements Strategy
         $path .= $config['path_separator'];
 
         if ($parent) {
+            // Ensure parent has been initialized in the case where it's a proxy
+            $om->initializeObject($parent);
+            
             $changeSet = $uow->isScheduledForUpdate($parent) ? $ea->getObjectChangeSet($uow, $parent) : false;
             $pathOrPathSourceHasChanged = $changeSet && (isset($changeSet[$config['path_source']]) || isset($changeSet[$config['path']]));