Skip to content

Commit 86ec9b1

Browse files
authored
Fixed #1567 - [Tree] verify() - relation as root - relation ad id fix
1 parent 669f48c commit 86ec9b1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,14 @@ private function verifyTree(&$errors, $root = null)
900900

901901
$identifier = $meta->getSingleIdentifierFieldName();
902902
if (isset($config['root'])) {
903-
$object = $meta->getReflectionProperty($config['root'])->getValue($root);
904-
$rootId = $object ? $meta->getReflectionProperty($identifier)->getValue($object): null;
903+
if (isset($config['root'])) {
904+
$rootId = $meta->getReflectionProperty($config['root'])->getValue($root);
905+
if (is_object($rootId)) {
906+
$rootId = $meta->getReflectionProperty($identifier)->getValue($rootId);
907+
}
908+
} else {
909+
$rootId = null;
910+
}
905911
} else {
906912
$rootId = null;
907913
}

0 commit comments

Comments
 (0)