1 text.module text_field_is_empty($item, $field)

Implements hook_field_is_empty().

File

core/modules/field/modules/text/text.module, line 159
Defines simple text field types.

Code

function text_field_is_empty($item, $field) {
  if (!isset($item['value']) || $item['value'] === '') {
    if (isset($item['format']) && $item['format'] !== '') {
      // If this text field has a text format setting,
      // save it regardless of empty value to keep the format.
      return FALSE;
    }
    elseif (!isset($item['summary']) || $item['summary'] === '') {
      // Neither value nor summary nor format are set,
      // no need to save to database.
      return TRUE;
    }
  }
  return FALSE;
}