In case of only 'link text' is required, then remove the required mark if the user deletes the text entered for URL

Created on 13 December 2015, over 9 years ago
Updated 11 August 2025, 12 days ago

Problem/Motivation

After posting a node-add form with only URL in a field which only 'Link text' is required the form does not allow the user to change his mind and not post anything for the link field.

How to reproduce:

  • Create a link field
  • Do not check the link field option Required field
  • Select Required for Allow link text
  • Open the for to add a new node and add text only for the link URL
  • After submitting the form it will display an error message that the link filed is required
  • Delete the text at the URL and submit the form again (Suppose the user do not want to fill this link anymore)
  • The form will not change the required attribute and will not allow the user to give up inserting something.

The expected outcome would be allow the user to change his mind and not post anything for this field, as it is done before submitting the node-add form for the first time.

Proposed resolution

- Add help text for the 'Link text', something like : The link text will be required if you insert an URL.
- Change the attribute required of 'Link text' in case the user deletes what he/she has input for URL.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

11.0 πŸ”₯

Component

link.module

Created by

πŸ‡§πŸ‡·Brazil Mac_Weber

Live updates comments and jobs are added and updated live.
  • 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.

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