Updating a field
In Drupal 6 we had $element['_error_element'] which is gone in Drupal 7, replaced by new function hook_field_widget_error().
The hook_widget() function has been renamed to hook_field_widget_form(), and it has several new parameters passed to it. */ function number_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) /** * Implements hook_field_widget_error().
New in Drupal 7, you declare all the widget settings in the info hook and set default values for the settings.
In Drupal 6 we had $element['_error_element'] which is gone in Drupal 7, replaced with a $error array that is passed by reference to the validator. * * Possible error codes: * - 'number_min': The value is smaller than the allowed minimum value.
*/ function myfield_field_settings_form_validate($element, &$form_state) If your D6 hook_field_settings() supported $op == 'views data' then that logic will have to be moved.
To add support for relationships your module should implement hook_field_views_data() or hook_field_views_data_alter() to add the necessary information. Each of the operations in hook_field is now a separate hook, hook_field_validate, hook_field_insert, hook_field_update, etc.
Several things that were field values in Drupal 6 are now instance values: required, label, description, widget.
There are now separate weights for the widget, and the display.