From 7d1b24f3b1fde6e12385c299ba6ea4b0da385031 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Mon, 26 Sep 2022 13:16:38 +0200 Subject: [PATCH] attempt a fix --- src/UnitOfWork.php | 4 ++-- .../Tests/ORM/Functional/Ticket/LazyEagerCollectionTest.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 2969a3e0e0f..0f775910d83 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -2473,13 +2473,13 @@ private function doRefresh($entity, array &$visited, ?int $lockMode = null): voi throw ORMInvalidArgumentException::entityNotManaged($entity); } + $this->cascadeRefresh($entity, $visited, $lockMode); + $this->getEntityPersister($class->name)->refresh( array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]), $entity, $lockMode ); - - $this->cascadeRefresh($entity, $visited, $lockMode); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/LazyEagerCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/LazyEagerCollectionTest.php index 2797dfd67bb..926e0523153 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/LazyEagerCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/LazyEagerCollectionTest.php @@ -17,6 +17,7 @@ class LazyEagerCollectionTest extends OrmFunctionalTestCase protected function setUp(): void { parent::setUp(); + $this->createSchemaForModels( LazyEagerCollectionUser::class, LazyEagerCollectionAddress::class,