From f79f787616e23386ab5347be7552723c82d1a381 Mon Sep 17 00:00:00 2001 From: Yorkie Chadwick Date: Mon, 26 Oct 2020 10:08:33 +0100 Subject: [PATCH] Update PageListener.php refresh object to maintain template changes when path changes --- src/Entity/PageListener.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Entity/PageListener.php b/src/Entity/PageListener.php index dd9e9fd6c..d497f9e59 100644 --- a/src/Entity/PageListener.php +++ b/src/Entity/PageListener.php @@ -63,6 +63,7 @@ public function onFlush(OnFlushEventArgs $args) foreach ($unitOfWork->getScheduledEntityUpdates() as $entity) { if ($entity instanceof PageInterface) { if ($contentRoute = $entity->getContentRoute()) { + $em->refresh($contentRoute); $contentRoute->setPath(PageHelper::getPageRoutePath($entity->getPath())); $em->persist($contentRoute); $unitOfWork->computeChangeSet($em->getClassMetadata(get_class($contentRoute)), $contentRoute);