Skip to content

Commit 1d7c73b

Browse files
committed
Update getByLocale method in FrontendPageController
Refactored the getByLocale method in the FrontendPageController to extract the root alias dynamically. This change enhances the flexibility of the method and ensures proper handling of queries regardless of the alias used in the query builder.
1 parent 61cf8b5 commit 1d7c73b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Controller/FrontendPageController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,9 @@ public function getJsonUrlsAction(Request $request): JsonResponse
705705

706706
$qb = $pageAdmin->createQuery();
707707

708-
$pageAdmin->getByLocale($qb, 'p', 'locale', ['value' => $locale]);
708+
$alias = $qb->getRootAliases();
709+
710+
$pageAdmin->getByLocale($qb, $alias[0], 'locale', ['value' => $locale]);
709711

710712
$qb->setSortBy([], ['fieldName' => 'path']);
711713

0 commit comments

Comments
 (0)