You are here

function isbn_field_presave in ISBN Field 7

Implements hook_field_presave().

File

./isbn.module, line 145
Maintains a consistant relationship between nodes and ISBNs.

Code

function isbn_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  if ($field['type'] == 'isbn') {
    foreach ($items as $delta => $item) {

      // Cleaning the data before saving it.
      if (isset($item['isbn'])) {
        $items[$delta]['isbn'] = isbn_clean_data($item['isbn']);
      }
    }
  }
}