support getPathByAlias()

Created on 3 December 2019, over 5 years ago
Updated 15 February 2023, about 2 years ago

Suppose the alias for '/node/123' is '/article/foo'.

Calling \Drupal::service('path.alias_manager')->getPathByAlias('/article/foo') returns '/node/123'. This is a useful Drupal core function at times.

However, \Drupal::service('path.alias_manager')->getPathByAlias('/article/foo/edit') returns '/article/foo/edit', while I would have hoped/expected to get '/node/123/edit'.

Is it possible for the module to support this?

Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands marcvangend Amsterdam

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.

  • 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)

    I don't think this would be very feasible. The module doesn't create aliases for all the paths, it uses path processing to make it as if those are the real paths. I'd love to be proven wrong because I can see cases that would be not ideal, but I think that is a limitation of this implementation.

Production build 0.71.5 2024