Convert absolute URLs to internal paths

Created on 13 May 2020, over 4 years ago
Updated 26 July 2023, about 1 year ago

Problem/Motivation

URLs that are filled into a link field should be stored as the internal path when possible. Currently this works if the field is used to search for the destination using the autocomplete field, but it doesn't work if the absolute URL for that path is pasted in.

Proposed resolution

If someone fills in a link field with an absolute URL link to a path on the site, the link field should convert the values to the internal paths.

Remaining tasks

User interface changes

None?

API changes

TBD.

Data model changes

TBD.

Release notes snippet

TBD.

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
LinkΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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.

  • πŸ‡ΊπŸ‡ΈUnited States devkinetic

    Another +1 here. Building a new project and immediately content authors have already begun using internal links incorrectly, despite the existing help text. The contrib module is helping out with this.

    Also, slightly different use case, and most likely another new issue is links to media, for example linking to /sites/xxxx/files/xxxx.pdf vs media/xxxx. I may end up coding my own presave to handle that, as I am using the contrib media url module that adds /download to each media item alias.

    Any work we can do to promote/enforce best practices will go a long way. A few years down the line many sites become plagued with broken links and there is no simple or cheap way to fix it.

  • πŸ‡ΊπŸ‡ΈUnited States robphillips

    Check out this module if you need to convert absolute URLs with text formats:
    https://www.drupal.org/project/convert_url_filter β†’

Production build 0.71.5 2024