When the textfield does not validate, the field is not assigned the "error" class and is not highlighted.
I am using version 7.x-1.0+8-dev on drupal 7

I solved the issue by adding a line of code but I don't know if there is a better way
Added to line 222:

    // Add "error" class to non-valid field.
    $form_state["complete form"]["field_location"]["und"][0]["select_other_text_input"]['#attributes']['class'][0] .= " error"; 
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mradcliffe’s picture

Yes, for some reason it's not adding the class when form_set_error or form_error is called. This is usually automatic, but it's probably getting confused by the array parents.

mradcliffe’s picture

Status: Active » Needs review
FileSize
1.34 KB

Here's a patch (combined, i have two commits ready). Let's see how badly it fails on PIFR (Can't run tests locally because MAMP/Simpletest seems to be borked).

mradcliffe’s picture

Status: Needs review » Needs work

Welp. Even pifr can't run tests (branch fails on something that passes everywhere else).

This works for me. Passes all tests on another box just fine. Just need to add an assertion for the class in the validation test.

mradcliffe’s picture

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

updated formatting