Implements hook_field_widget_error().
function field_test_field_widget_error($element, $error, $form, &$form_state) {
// @todo No easy way to differenciate widget types, we should receive it as a
// parameter.
if (isset($element['value'])) {
// Widget is test_field_widget.
$error_element = $element['value'];
}
else {
// Widget is test_field_widget_multiple.
$error_element = $element;
}
form_error($error_element, $error['message']);
}