case 'process form values':
if ($field['multiple']) {
// if nothing selected, make it 'none'
if (empty($items['nids'])) {
$items['nids'] =
array(0 =>
'0');
}
// drop the 'none' options if other items were also selected
elseif (count($items['nids']) >
1) {
unset($items['nids'][0]);
}
$items =
array_values(content_transpose_array_rows_cols
(array('nid' =>
$items['nids'])));
}
else {
$items[0]['nid'] = $items['nids'];
}
// Remove the widget's data representation so it isn't saved.
foreach ($items as $delta => $item) {
$items[$delta]['error_field'] = $field['field_name'] .'][nids';
}