Cannot generate the entity canonical url by passing the entity UUID

Created on 27 February 2020, over 4 years ago
Updated 19 December 2023, 6 months ago

When a param converter applies to the entity canonical route, RouterPathTranslatorSubscriber will try to generate the canonical url using the entity uuid, which fails and can't ever work because of the digit requirement ($route->setRequirement($entity_type_id, '\d+');), added to entity canonical route by Drupal\Core\Entity\RoutingDefaultHtmlRouteProvider::getCanonicalRoute()...

As a result, a 500 response is returned by the endpoint for translating paths (router/translate-path) in this scenario.
The attached patch fixes it...

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024