Allow linky to support internal URL's

Created on 3 April 2024, 6 months ago

Problem/Motivation

Linky replacer can be optionally configured to include internal/local links, which are stored within linky.
The problem is that then linky isn't configured to allow internal links and thus causes problems with trying to edit the links within linky.

Steps to reproduce

Install and configure both linky and linky replacer into a system. Configure linky replacer to allow internal links.

Create some content and link to a path of "/node/1" (assuming the environment has node 1) and save. This will get created as a managed link.

Now edit the internal link in managed links and alter the link title and save.

This will then cause a crash in a validator, because routed url's do not have a URI which will cause a crash.

Once this issue has been resolved, the URL's will not be allowed for a url like "entity:node/1" since the link field is only configured to support external URL's.

Proposed resolution

Fix up the issue with the \Drupal\linky\Plugin\Validation\Constraint\LinkyLinkConstraintValidator::validate() to work with routed links.

Change the link field configuration to allow both internal and external links.

Linky replacer has a configuration which specifies that it can import internal links. I am not sure if this is applicable to Linky as links are added manually, and the editor can determine if they want external or external.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia gordon Melbourne

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

Comments & Activities

  • Issue created by @gordon
  • Status changed to Needs review 6 months ago
  • 🇦🇺Australia gordon Melbourne

    I have fixed up the 2 items that I have found which break local URL's and I will do some more testing.

Production build 0.71.5 2024