From 7c7220c37633de399141bd91837101dcaab48f9b Mon Sep 17 00:00:00 2001 From: pawelpawlik Date: Thu, 26 Mar 2026 09:46:40 +0100 Subject: [PATCH] IBX-11423: added optional parameter $showAllTranslations to URLAliasService::load --- .../Repository/Decorator/URLAliasServiceDecorator.php | 4 ++-- src/contracts/Repository/URLAliasService.php | 3 ++- src/lib/Repository/SiteAccessAware/URLAliasService.php | 4 ++-- src/lib/Repository/URLAliasService.php | 5 +++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/contracts/Repository/Decorator/URLAliasServiceDecorator.php b/src/contracts/Repository/Decorator/URLAliasServiceDecorator.php index df87d13f3b..08c006b8cf 100644 --- a/src/contracts/Repository/Decorator/URLAliasServiceDecorator.php +++ b/src/contracts/Repository/Decorator/URLAliasServiceDecorator.php @@ -92,9 +92,9 @@ public function reverseLookup( ); } - public function load(string $id): URLAlias + public function load(string $id, ?bool $showAllTranslations = null): URLAlias { - return $this->innerService->load($id); + return $this->innerService->load($id, $showAllTranslations); } public function refreshSystemUrlAliasesForLocation(Location $location): void diff --git a/src/contracts/Repository/URLAliasService.php b/src/contracts/Repository/URLAliasService.php index b2df187f29..05a35e01e7 100644 --- a/src/contracts/Repository/URLAliasService.php +++ b/src/contracts/Repository/URLAliasService.php @@ -156,10 +156,11 @@ public function reverseLookup( * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException * * @param string $id + * @param bool|null $showAllTranslations If enabled will include all alias as if they where always available. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\URLAlias */ - public function load(string $id): URLAlias; + public function load(string $id, ?bool $showAllTranslations = null): URLAlias; /** * Refresh all system URL aliases for the given Location (and historize outdated if needed). diff --git a/src/lib/Repository/SiteAccessAware/URLAliasService.php b/src/lib/Repository/SiteAccessAware/URLAliasService.php index 897490a9ec..21120282e4 100644 --- a/src/lib/Repository/SiteAccessAware/URLAliasService.php +++ b/src/lib/Repository/SiteAccessAware/URLAliasService.php @@ -103,9 +103,9 @@ public function reverseLookup( ); } - public function load(string $id): URLAlias + public function load(string $id, ?bool $showAllTranslations = null): URLAlias { - return $this->service->load($id); + return $this->service->load($id, $showAllTranslations); } public function refreshSystemUrlAliasesForLocation(Location $location): void diff --git a/src/lib/Repository/URLAliasService.php b/src/lib/Repository/URLAliasService.php index 8e0d96ad67..887f610108 100644 --- a/src/lib/Repository/URLAliasService.php +++ b/src/lib/Repository/URLAliasService.php @@ -721,16 +721,17 @@ public function reverseLookup( * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException * * @param string $id + * @param bool|null $showAllTranslations If enabled will include all alias as if they where always available. * * @return \Ibexa\Contracts\Core\Repository\Values\Content\URLAlias */ - public function load(string $id): URLAlias + public function load(string $id, ?bool $showAllTranslations = null): URLAlias { $spiUrlAlias = $this->urlAliasHandler->loadUrlAlias($id); $path = $this->extractPath( $spiUrlAlias, null, - $this->languageResolver->getShowAllTranslations(), + $this->languageResolver->getShowAllTranslations($showAllTranslations), $this->languageResolver->getPrioritizedLanguages() );