diff --git a/src/EventSubscriber/RouterPathTranslatorSubscriber.php b/src/EventSubscriber/RouterPathTranslatorSubscriber.php index 5378d3b..14ecb53 100644 --- a/src/EventSubscriber/RouterPathTranslatorSubscriber.php +++ b/src/EventSubscriber/RouterPathTranslatorSubscriber.php @@ -134,10 +134,8 @@ class RouterPathTranslatorSubscriber implements EventSubscriberInterface { return; } /** @var \Drupal\Core\Entity\EntityInterface $entity */ - /** @var bool $param_uses_uuid */ [ $entity, - $param_uses_uuid, $route_parameter_entity_key, ] = $this->findEntityAndKeys($match_info); if (!$entity) { @@ -172,7 +170,7 @@ class RouterPathTranslatorSubscriber implements EventSubscriberInterface { watchdog_exception('decoupled_router', $e); return; } - $entity_param = $param_uses_uuid ? $entity->id() : $entity->uuid(); + $entity_param = $entity->id(); $resolved_url = Url::fromRoute($match_info[RouteObjectInterface::ROUTE_NAME], [ $route_parameter_entity_key => $entity_param, ], ['absolute' => TRUE])->toString(TRUE); @@ -246,22 +244,21 @@ class RouterPathTranslatorSubscriber implements EventSubscriberInterface { } /** - * Get the underlying entity and the type of ID param enhancer for the routes. + * Get the underlying entity and the type of ID param enhancer for the + * routes. * * @param array $match_info * The router match info. * * @return array * The pair of \Drupal\Core\Entity\EntityInterface and bool with the - * underlying entity and the info weather or not it uses UUID for the param - * enhancement. It also returns the name of the parameter under which the - * entity lives in the route ('node' vs 'entity'). + * underlying entity. It also returns the name of the parameter under which + * the entity lives in the route ('node' vs 'entity'). */ protected function findEntityAndKeys(array $match_info) { $entity = NULL; /** @var \Symfony\Component\Routing\Route $route */ $route = $match_info[RouteObjectInterface::ROUTE_OBJECT]; - $route_parameters = $route->getOption('parameters'); $route_parameter_entity_key = 'entity'; if ( !empty($match_info['entity']) && @@ -284,12 +281,8 @@ class RouterPathTranslatorSubscriber implements EventSubscriberInterface { $entity = $match_info[$entity_type_id]; } } - $param_uses_uuid = strpos( - $route_parameters[$route_parameter_entity_key]['converter'], - 'entity_uuid' - ) === FALSE; - return [$entity, $param_uses_uuid, $route_parameter_entity_key]; + return [$entity, $route_parameter_entity_key]; } /**