From 365613ccabaa04ef2b35a4549b1d8eb913e3363d Mon Sep 17 00:00:00 2001 From: glo82145 Date: Fri, 24 Nov 2023 18:21:10 +0530 Subject: [PATCH] PWA-3221::PWA Upward connector throws exception --- Model/PageType.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Model/PageType.php b/Model/PageType.php index d4c676d..873629c 100644 --- a/Model/PageType.php +++ b/Model/PageType.php @@ -197,13 +197,11 @@ private function findFinalUrl(string $requestPath, int $storeId, bool $findCusto $urlRewrite = $this->findUrlFromRequestPath($requestPath, $storeId); if ($urlRewrite) { $this->redirectType = $urlRewrite->getRedirectType(); - if($urlRewrite->getRedirectType() > 0) { - while ($urlRewrite && $urlRewrite->getRedirectType() > 0) { - $urlRewrite = $this->findUrlFromRequestPath($urlRewrite->getTargetPath(), $storeId); - } - } else { - $urlRewrite = $this->findUrlFromTargetPath($requestPath, $storeId); + while ($urlRewrite && $urlRewrite->getRedirectType() > 0) { + $urlRewrite = $this->findUrlFromRequestPath($urlRewrite->getTargetPath(), $storeId); } + } else { + $urlRewrite = $this->findUrlFromTargetPath($requestPath, $storeId); } if ($urlRewrite && ($findCustom && !$urlRewrite->getEntityId() && !$urlRewrite->getIsAutogenerated())) { $urlRewrite = $this->findUrlFromTargetPath($urlRewrite->getTargetPath(), $storeId);