From 4480440ee4d932d1b51f500b8cfe621899194465 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Wed, 18 Apr 2018 11:17:52 +0200 Subject: [PATCH] fix wrong array index mapping --- src/I18nBundle/Adapter/PathGenerator/Document.php | 7 ++++--- src/I18nBundle/Adapter/PathGenerator/StaticRoute.php | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/I18nBundle/Adapter/PathGenerator/Document.php b/src/I18nBundle/Adapter/PathGenerator/Document.php index b83e36e..49451ee 100644 --- a/src/I18nBundle/Adapter/PathGenerator/Document.php +++ b/src/I18nBundle/Adapter/PathGenerator/Document.php @@ -62,7 +62,7 @@ private function documentUrlsFromLanguage(PimcoreDocument $currentDocument, $onl 'locale' => $pageInfo['locale'], 'hrefLang' => $pageInfo['hrefLang'], 'localeUrlMapping' => $pageInfo['localeUrlMapping'], - 'key' => $pageInfo['key'], + 'key' => $currentDocument->getKey(), 'url' => $pageInfo['url'] ]; } @@ -140,8 +140,7 @@ private function documentUrlsFromCountry(PimcoreDocument $currentDocument, $only 'locale' => $pageInfo['locale'], 'hrefLang' => $pageInfo['hrefLang'], 'localeUrlMapping' => $pageInfo['localeUrlMapping'], - 'key' => $pageInfo['key'], - 'relativePath' => $pageInfo['key'], + 'key' => $currentDocument->getKey(), 'url' => $pageInfo['url'] ]; } @@ -200,6 +199,7 @@ private function documentUrlsFromCountry(PimcoreDocument $currentDocument, $only $routes[] = [ 'languageIso' => $pageInfo['languageIso'], 'countryIso' => $pageInfo['countryIso'], + 'locale' => $pageInfo['locale'], 'hrefLang' => $pageInfo['hrefLang'], 'localeUrlMapping' => $pageInfo['localeUrlMapping'], 'key' => $document->getKey(), @@ -207,6 +207,7 @@ private function documentUrlsFromCountry(PimcoreDocument $currentDocument, $only 'hasPrettyUrl' => $hasPrettyUrl, 'url' => $url ]; + //document does not exist. } else { $hardLinksToCheck[] = $pageInfo; diff --git a/src/I18nBundle/Adapter/PathGenerator/StaticRoute.php b/src/I18nBundle/Adapter/PathGenerator/StaticRoute.php index 628e3f2..40c7c2b 100644 --- a/src/I18nBundle/Adapter/PathGenerator/StaticRoute.php +++ b/src/I18nBundle/Adapter/PathGenerator/StaticRoute.php @@ -100,7 +100,6 @@ public function getUrls(PimcoreDocument $currentDocument = null, $onlyShowRootLa 'countryIso' => $pageInfo['countryIso'], 'hrefLang' => $pageInfo['hrefLang'], 'localeUrlMapping' => $pageInfo['localeUrlMapping'], - 'key' => $pageInfo['key'], 'url' => $pageInfo['url'], 'domainUrl' => $pageInfo['domainUrl'] ]; @@ -149,7 +148,6 @@ public function getUrls(PimcoreDocument $currentDocument = null, $onlyShowRootLa 'locale' => $routeInfo['locale'], 'hrefLang' => $routeInfo['hrefLang'], 'localeUrlMapping' => $routeInfo['localeUrlMapping'], - 'key' => $routeInfo['key'], # use domainUrl element since $link already comes with the locale part! 'url' => System::joinPath([$routeInfo['domainUrl'], $link]) ];