From e8ba575c0b63927211e19d90d5fdb8e2af06f407 Mon Sep 17 00:00:00 2001 From: Christian Lopez Espinola Date: Thu, 21 Jan 2016 14:28:04 +0100 Subject: [PATCH] When using different negotiation methods for interface and content, there are redirect loops --- src/EventSubscriber/RedirectRequestSubscriber.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EventSubscriber/RedirectRequestSubscriber.php b/src/EventSubscriber/RedirectRequestSubscriber.php index fbeb863..c2e5f09 100644 --- a/src/EventSubscriber/RedirectRequestSubscriber.php +++ b/src/EventSubscriber/RedirectRequestSubscriber.php @@ -11,6 +11,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Logger\RfcLogLevel; use Drupal\Core\Path\AliasManager; @@ -238,7 +239,7 @@ public function redirectNormalizeAliases(GetResponseEvent $event) { $system_path = $this->aliasManager->getPathByAlias($path); - $alias = $this->aliasManager->getAliasByPath($system_path, $this->languageManager->getCurrentLanguage() + $alias = $this->aliasManager->getAliasByPath($system_path, $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT) ->getId()); // If the alias defined in the system is not the same as the one via which // the page has been accessed do a redirect to the one defined in the