RouterPathTranslatorSubscriber uses wrong param when resolving the url

Created on 29 December 2023, 12 months ago
Updated 26 May 2024, 7 months ago

Problem/Motivation

When you use the RouterPathTranslator for example when you want to resolve the alias for a product entity an exception is thrown as uses the uuid not the uid.

Steps to reproduce

Enable decoupled_router on Drupal commerce.
Call the decoupled_router.path_translation with the given path.

Proposed resolution

Replace the order of the variables in the RouterPathTranslatorSubscriber to match the logic.
Currently its:
$entity_param = $param_uses_uuid ? $entity->id() : $entity->uuid();
it should be:
$entity_param = $param_uses_uuid ? $entity->uuid() : $entity->id();

Now the uuid is set if the param requires the id.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands thomasdik

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024