URL validation of link field doesn't work

Created on 8 April 2021, over 3 years ago
Updated 6 March 2024, 8 months ago

I have a link field and a boolean field. The link field will be displayed when the checkbox is ticked. However, the validation of the URL field stopped from working. The URL validation is working OK with no conditional rule.

I'm expecting to see the Manually entered paths should start with one of the following characters: / ? # error message when submitting the node. Without the validation, the front-end gets InvalidArgumentException: The internal path component 'www.google.com' is invalid. Its path component must have a leading slash, e.g. internal:/foo. in Drupal\Core\Url::fromInternalUri() (line 413 of core/lib/Drupal/Core/Url.php). error.

Steps to reproduce:

1. Manage dependencies.
2. Add link field in target field.
3. Add boolean field in controlled by.
4. The dependency would be the target field is visible when the control field is checked.
5. Edit or add a new node.
6. Tick checkbox.
7. Enter an URL that starts with "www" (eg. www.google.com) in the link field.
8. Save.
9. Check the node page.

🐛 Bug report
Status

Needs work

Version

4.0

Component

Compatibility w/ other modules

Created by

🇵🇭Philippines madelyncruz

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.

Production build 0.71.5 2024