소스 검색

Merge pull request #459 from craigmarvelley/458-ensure-parent-is-initialized

Ensure parent is initialized before node update
Gustavo Falco 12 년 전
부모
커밋
9f0acb49b7
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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']]));