1 field.info.inc _field_info_prepare_field($field)

Prepares a field definition for the current run-time context.

Since the field was last saved or updated, new field settings can be expected.


$field: The raw field structure as read from the database.

Related topics


core/modules/field/field.info.inc, line 290
Field Info API, providing information about available fields and field types.


function _field_info_prepare_field($field) {
  // Make sure all expected field settings are present.
  $field += array(
    'settings' => array(),
    'storage' => array(),
    'bundles' => array(),
  $field['settings'] += field_info_field_settings($field['type']);
  $field['storage']['settings'] += field_info_storage_settings($field['storage']['type']);

  // Add storage details.
  $details = (array) module_invoke($field['storage']['module'], 'field_storage_details', $field);
  backdrop_alter('field_storage_details', $details, $field, $instance);
  $field['storage']['details'] = $details;

  return $field;