You are here

function _imagefield_widget_form_validate in ImageField 5

1 call to _imagefield_widget_form_validate()
imagefield_widget in ./imagefield.module
Implementation of hook_widget().

File

./imagefield.module, line 551
Defines an image field type. imagefield uses content.module to store the fid, and the drupal files table to store the actual file data.

Code

function _imagefield_widget_form_validate($node, $field, $node_field) {
  $fieldname = $field['field_name'];
  if ($field['required']) {
    if (!count($node_field)) {
      form_set_error($fieldname, $field['widget']['label'] . ' is required.');
    }
  }
}