In user_reference_autocomplete_validate(), the following code is used:

  $field = $form_state['field'][$element['#field_name']][$element['#language']]['field'];
  $instance = $form_state['field'][$element['#field_name']][$element['#language']]['instance'];

These can be replaced with calls to field_widget_field() and field_widget_instance(). I haven't checked if there are other possible improvements in other places.

Comments

ogi’s picture

#950138: Abstract Field API $form_state usage into an API function was the issue that added these helper functions.

yched’s picture

Status: Active » Fixed

Very true, has been fixed meanwhile.

Status: Fixed » Closed (fixed)

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

lukasss’s picture

Issue summary: View changes

sorry