When submitting a form with a link field that has a invalid URL, a validation error message is shown but the field isn't highlighted (it hasn't the "error" class).
I've attached a screenshot of it in a clean Drupal installation.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | link-validation.patch | 3.27 KB | effulgentsia |
| Create Page | Link.png | 121.1 KB | luisortizramos |
Comments
Comment #1
effulgentsia commentedIn D7, to support field translation modules, field input elements are scoped to language. Here's a patch to fix the corresponding form_set_error() calls. Note that calling form_set_error() within field-level validation is not recommended in D7. Instead, widgets can validate input elements, and hook_field_validate() should add errors to the passed in $errors variable, but let's leave that refactoring to a separate issue, and keep this patch as a simple fix for targeting the input elements correctly.
Comment #2
luisortizramos commentedI've tested the patch in a fresh Drupal instance with the Link module and it worked like a charm.
Comment #3
rvilarWorking for me
Comment #4
dqdpatch review, tested, committed and pushed to HEAD (latest --dev)
effulgentsia++