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.

Comments

effulgentsia’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new3.27 KB

In 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.

luisortizramos’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the patch in a fresh Drupal instance with the Link module and it worked like a charm.

rvilar’s picture

Working for me

dqd’s picture

Status: Reviewed & tested by the community » Fixed

patch review, tested, committed and pushed to HEAD (latest --dev)

effulgentsia++

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.