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 @@ -230,8 +230,8 @@ protected function meetsContentEntityRoutesCondition($outbound_route_name, Request $request) { $storage = isset($this->paths[$request]) ? $this->paths[$request] : []; if (!isset($storage[$outbound_route_name])) { - $content_entity_path_for_current_route = $this->getContentEntityPathForCurrentRequest($request); - $meets_condition = $content_entity_path_for_current_route ? $this->meetsOutboundRouteToCurrentContentEntityCondition($outbound_route_name, $request) : FALSE; + $content_entity_type_id_for_current_route = $this->getContentEntityTypeIdForCurrentRequest($request); + $meets_condition = $content_entity_type_id_for_current_route ? $this->meetsOutboundRouteToCurrentContentEntityCondition($outbound_route_name, $request) : FALSE; $storage[$outbound_route_name] = $meets_condition; $this->paths[$request] = $storage; } @@ -240,29 +240,28 @@ } /** - * Returns the content entity path from the current request. + * Returns the content entity type id from the current request for the route. * * @param \Symfony\Component\HttpFoundation\Request $request * The HttpRequest object representing the current request. * * @return string - * The path pattern for the content entity from the request. + * The entity type id for the route from the request. */ - protected function getContentEntityPathForCurrentRequest(Request $request) { - $content_entity_path_for_current_route = ''; + protected function getContentEntityTypeIdForCurrentRequest(Request $request) { + $content_entity_type_id_for_current_route = ''; if ($current_route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME)) { $current_route_path = $this->routeProvider->getRouteByName($current_route_name)->getPath(); - $content_entity_path_for_current_route = isset($this->getContentEntityPaths()[$current_route_path]) ? $this->getContentEntityPaths()[$current_route_path] : ''; + $content_entity_type_id_for_current_route = isset($this->getContentEntityPaths()[$current_route_path]) ? $this->getContentEntityPaths()[$current_route_path] : ''; } - return $content_entity_path_for_current_route; + return $content_entity_type_id_for_current_route; } /** * Determines if outbound route points to the current entity. * - * * @param $outbound_route_name * The route name for the current outbound url being processed. * @param \Symfony\Component\HttpFoundation\Request $request @@ -273,9 +272,9 @@ * FALSE otherwise. */ protected function meetsOutboundRouteToCurrentContentEntityCondition($outbound_route_name, Request $request) { - if ($content_entity_path_for_current_route = $this->getContentEntityPathForCurrentRequest($request)) { + if ($content_entity_type_id_for_current_route = $this->getContentEntityTypeIdForCurrentRequest($request)) { $outbound_route_path = $this->routeProvider->getRouteByName($outbound_route_name)->getPath(); - if (!empty($this->getContentEntityPaths()[$outbound_route_path]) && $content_entity_path_for_current_route == $this->getContentEntityPaths()[$outbound_route_path]) { + if (!empty($this->getContentEntityPaths()[$outbound_route_path]) && $content_entity_type_id_for_current_route == $this->getContentEntityPaths()[$outbound_route_path]) { return TRUE; } }