Generate URL instead of just alias for :url token

Created on 21 January 2021, over 3 years ago
Updated 20 January 2023, over 1 year 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.69.0 2024