diff --git a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php index 980759d..188c1c9 100644 --- a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php +++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php @@ -116,7 +116,11 @@ public function getLangcode(Request $request = NULL) { * {@inheritdoc} */ public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) { - // Check if processing conditions are met. + // If appropriate, process outbound to add a query parameter to the url and + // remove the language option, so that url negotiator does not rewrite the + // url. + + // First, check if processing conditions are met. if (!($request && !empty($options['route_name']) && $this->hasHigherLanguageNegotiationOrder() && $this->meetsContentEntityRoutesCondition($options['route_name'], $request))) { return $path; } @@ -183,10 +187,8 @@ public function getLanguageSwitchLinks(Request $request, $type, Url $url) { * Determines if content entity language negotiator has higher priority. * * The content entity language negotiator having higher priority than the url - * language negotiator, is a criteria for deciding if - * \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound() - * should be executed to remove the language option, so that url negotiator - * does not rewrite the url. + * language negotiator, is a criteria in + * \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound(). * * @return bool * TRUE if the the content entity language negotiator has higher priority