Skip to content

Commit dcaab46

Browse files
authored
Merge pull request #1647 from kbond/2.4-php7-nested-set-fix
PHP 7 nested set fix for 2.4
2 parents 24cd861 + 15399be commit dcaab46

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Gedmo/Tree/Strategy/ORM/Nested.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,13 @@ public function shiftRL(EntityManager $em, $class, $first, $delta, $root = null)
533533
if ($node instanceof Proxy && !$node->__isInitialized__) {
534534
continue;
535535
}
536+
537+
$nodeMeta = $em->getClassMetadata(get_class($node));
538+
539+
if (!array_key_exists($config['left'], $nodeMeta->getReflectionProperties())) {
540+
continue;
541+
}
542+
536543
$oid = spl_object_hash($node);
537544
$left = $meta->getReflectionProperty($config['left'])->getValue($node);
538545
$currentRoot = isset($config['root']) ? $meta->getReflectionProperty($config['root'])->getValue($node) : null;
@@ -599,6 +606,13 @@ public function shiftRangeRL(EntityManager $em, $class, $first, $last, $delta, $
599606
if ($node instanceof Proxy && !$node->__isInitialized__) {
600607
continue;
601608
}
609+
610+
$nodeMeta = $em->getClassMetadata(get_class($node));
611+
612+
if (!array_key_exists($config['left'], $nodeMeta->getReflectionProperties())) {
613+
continue;
614+
}
615+
602616
$left = $meta->getReflectionProperty($config['left'])->getValue($node);
603617
$right = $meta->getReflectionProperty($config['right'])->getValue($node);
604618
$currentRoot = isset($config['root']) ? $meta->getReflectionProperty($config['root'])->getValue($node) : null;

0 commit comments

Comments
 (0)