Skip to content

Commit

Permalink
Force url as routePath
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Jul 25, 2024
1 parent 82eeaa8 commit 8ff222b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PhpcrMigration/Application/Persister/AbstractPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ protected function createOrUpdateRoute(array $document): void
'locale' => $locale,
]
);
} catch (\Exception $e) {
} catch (\Exception $e) { // @phpstan-ignore-line
echo \PHP_EOL;
echo \PHP_EOL;
echo $e->getMessage();
Expand Down
6 changes: 4 additions & 2 deletions PhpcrMigration/Application/Persister/ArticlePersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ protected function mapData(array $document, ?string $locale, array $data, bool $
if (isset($document['localizations'][$locale]['routePathName']) && isset($document['localizations'][$locale]['routePath'])) {
$routePathName = $document['localizations'][$locale]['routePathName'];
$routePathName = \str_starts_with($routePathName, 'i18n:') ? \explode('-', $routePathName, 2)[1] : $routePathName;
$routePath = $document['localizations'][$locale]['routePath'];
// check routePathName property and fallback to routePath
$routePath = $document['localizations'][$locale][$routePathName] ?? $document['localizations'][$locale]['routePath'];

$data['templateData'][$routePathName] = $routePath;
// content bundle is only compatible with "url"
$data['templateData']['url'] = $routePath;
}

return $data;
Expand Down

0 comments on commit 8ff222b

Please sign in to comment.