1 date.install date_update_1002()

Remove entries with null values from date field tables.

File

core/modules/date/date.install, line 108
Install, update and uninstall functions for the Date module.

Code

function date_update_1002() {
  // Get all date fields.
  $fields = field_info_fields();
  foreach ($fields as $field_name => $field) {
    if (in_array($field['type'], array('date', 'datetime', 'datestamp'))) {
      db_delete('field_data_' . $field_name)
        ->isNull($field_name . '_value')
        ->execute();
      db_delete('field_revision_' . $field_name)
        ->isNull($field_name . '_value')
        ->execute();
    }
  }
}