Skip to content

Instantly share code, notes, and snippets.

@pspanja
Created May 5, 2014 14:38
Show Gist options
  • Save pspanja/ea2702bbfcd8ecb94989 to your computer and use it in GitHub Desktop.
Save pspanja/ea2702bbfcd8ecb94989 to your computer and use it in GitHub Desktop.
diff --git a/eZ/Publish/Core/Repository/URLAliasService.php b/eZ/Publish/Core/Repository/URLAliasService.php
index 065956e..348a9a5 100644
--- a/eZ/Publish/Core/Repository/URLAliasService.php
+++ b/eZ/Publish/Core/Repository/URLAliasService.php
@@ -257,8 +257,23 @@ class URLAliasService implements URLAliasServiceInterface
*/
protected function selectAliasLanguageCode( SPIURLAlias $spiUrlAlias, $languageCode )
{
- if ( isset( $languageCode ) && !in_array( $languageCode, $spiUrlAlias->languageCodes ) )
+ if ( isset( $languageCode ) )
{
+ if ( !in_array( $languageCode, $spiUrlAlias->languageCodes ) )
+ {
+ return false;
+ }
+
+ if ( $spiUrlAlias->alwaysAvailable || $this->settings["showAllTranslations"] )
+ {
+ return $languageCode;
+ }
+
+ if ( in_array( $languageCode, $this->settings["prioritizedLanguageList"] ) )
+ {
+ return $languageCode;
+ }
+
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment