diff -u b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php --- b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php +++ b/core/modules/language/src/HttpKernel/PathProcessorLanguage.php @@ -179,7 +179,6 @@ * Resets the collected processors instances. */ public function reset() { - debug('reset path processor language'); $this->processors = array(); } diff -u b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php --- b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php +++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php @@ -52,11 +52,11 @@ protected $contentEntityPaths; /** - * Checks criteria for outbound processing. + * Static cache for the language negotiation order check. * * @var bool */ - protected $checkLanguageNegotiationOrder; + protected $languageNegotiationOrderCheckResult; /** * The route provider. @@ -187,7 +187,7 @@ * TRUE if the configuration condition is met, FALSE otherwise. */ protected function checkLanguageNegotiationOrder() { - if (!isset($this->checkLanguageNegotiationOrder)) { + if (!isset($this->languageNegotiationOrderCheckResult)) { // Only run if the LanguageNegotiationContentEntity outbound function is // being executed before the outbound function of LanguageNegotiationUrl. $enabled_methods_content = $this->config->get('language.types')->get('negotiation.language_content.enabled') ?: []; @@ -195,7 +195,7 @@ // Check if the content language is configured to be dependent on the // url negotiator directly or indirectly over the interface negotiator. if (isset($enabled_methods_content[LanguageNegotiationUrl::METHOD_ID]) && ($enabled_methods_content[static::METHOD_ID] > $enabled_methods_content[LanguageNegotiationUrl::METHOD_ID])) { - $this->checkLanguageNegotiationOrder = FALSE; + $this->languageNegotiationOrderCheckResult = FALSE; } else { $check_interface_method = FALSE; @@ -211,11 +211,11 @@ $check_against_weight = isset($enabled_methods_content[LanguageNegotiationUrl::METHOD_ID]) ? $enabled_methods_content[LanguageNegotiationUrl::METHOD_ID] : PHP_INT_MAX; } - $this->checkLanguageNegotiationOrder = $enabled_methods_content[static::METHOD_ID] < $check_against_weight; + $this->languageNegotiationOrderCheckResult = $enabled_methods_content[static::METHOD_ID] < $check_against_weight; } } - return $this->checkLanguageNegotiationOrder; + return $this->languageNegotiationOrderCheckResult; } /** only in patch2: unchanged: --- a/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php +++ b/core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorTest.php @@ -150,11 +150,16 @@ function testProcessInbound() { $current_user = $this->getMockBuilder('Drupal\Core\Session\AccountInterface') ->getMock(); + // Create a config event subscriber stub. + $config_subscriber = $this->getMockBuilder('Drupal\language\EventSubscriber\ConfigSubscriber') + ->disableOriginalConstructor() + ->getMock(); + // Create the processors. $alias_processor = new PathProcessorAlias($alias_manager); $decode_processor = new PathProcessorDecode(); $front_processor = new PathProcessorFront($config_factory_stub); - $language_processor = new PathProcessorLanguage($config_factory_stub, $this->languageManager, $negotiator, $current_user); + $language_processor = new PathProcessorLanguage($config_factory_stub, $this->languageManager, $negotiator, $current_user, $config_subscriber); // First, test the processor manager with the processors in the incorrect // order. The alias processor will run before the language processor, meaning