Cannot generate the entity canonical url by passing the entity UUID

Created on 27 February 2020, over 4 years ago
Updated 4 May 2023, over 1 year 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

RTBC

Version

1.0

Component

Code

Created by

🇮🇱Israel jsacksick

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.71.5 2024