Generate URL instead of just alias for :url token

Created on 21 January 2021, almost 4 years ago
Updated 20 January 2023, almost 2 years ago

Problem/Motivation

The :url token only returns the node alias, thus ignoring i.e. the language prefix.

Steps to reproduce

On a multilingual site, using the :url token and check the result.

Proposed resolution

Instead of

\Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid);

Use

Url::fromRoute('entity.node.canonical', ['node' => $nid]);

Remaining tasks

Review the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇷🇴Romania reszli Târgu Mureș

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

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