EditorLinkDialog should validate URLs, and autocomplete like the Link widget

Created on 24 June 2014, over 10 years ago
Updated 8 March 2024, 9 months ago

Postponed on #2407505: [meta] Finalize the menu links (and other user-entered paths) system β†’

Problem/Motivation

Despite issue 1879120, link URL entry in the WYSIWYG is inconsistent with link URL entry in the link field. To link to a specific node: in the WYSIWYG, you have to write "/node/#", in the Link URL field, you would write "node/#".
This is a user experience issue.

Proposed resolution

Make link URL entry consistent between how URLs are added in the WYSIWYG, and how link URLs are added in the link field.

EditorLinkDialog should transform Drupal paths, like the Link field does (LinkWidget::massageFormValues

<!-- See https://drupal.org/core-mentoring/novice-tasks for tips on identifying novice tasks. Delete or add "Novice" from the Novice? column in the table below as appropriate. Uncomment tasks as the issue advances. Update the Complete? column to indicate when they are done, and maybe reference the comment number where they were done. -->

(); ). EditorLinkDialog should not do this by pre-prending a slash because this would not work for sites installed in a subdirectory.

Remaining tasks

1. Complete patch - was blocked by #2347469 ?
2. Continue discussion of how it should work (output should be root relative path, drupal would store whatever user entered)
3. Add tests

User interface changes

In LinkDialog a user would enter "node/#" like they would do in a link field.

Original report by Charles Belov

Postponed on #2407505: [meta] Finalize the menu links (and other user-entered paths) system

Despite issue 1879120, link URL entry in the WYSIWYG is not consistent with link URL entry in the link field.

Steps:
1. Create a new Drupal 8.0-alpha12 website at simplytest.me
2. Enable the Link module
3. Add a link field to the Basic Page content type
4. Add content > Basic page > title "test page 1" (without the quotes) > Save and publish
5. Add content > Basic page
6. Title "test page 2"
7. Body - type "test page 1"
8. Select text "test page 1"
9. Click link icon
10. In the URL field, type "node/1"
11. Click OK
12. In the Basic Page Link URL field, type "node/1"
13. In the Basic Page Link Link text field, type "test page 1"
14. Click Save and publish
15. Click "test page 1" link corresponding to link field

Actual and expected results: Goes to [protocol]://[domain]/node/1 and displays test page 1

16. Click Back button
17. Click "test page 1" link corresponding to link in Body text

Actual result: Goes to [protocol]://[domain]/node/node/1 and displays not found error
Expected result: Goes to [protocol]://[domain]/node/1 and displays test page 1

✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
EditorΒ  β†’

Last updated about 24 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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