### Eclipse Workspace Patch 1.0 #P drupal_test_7 Index: modules/field/field.info.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.info.inc,v retrieving revision 1.6 diff -u -r1.6 field.info.inc --- modules/field/field.info.inc 5 Jun 2009 18:25:41 -0000 1.6 +++ modules/field/field.info.inc 25 Jun 2009 23:11:47 -0000 @@ -98,6 +98,7 @@ $info['field types'][$name]['module'] = $module; } } + drupal_alter('field_info', $info['field types']); // Populate widget types. foreach (module_implements('field_widget_info') as $module) { @@ -107,6 +108,7 @@ $info['widget types'][$name]['module'] = $module; } } + drupal_alter('field_widget_info', $info['widget types']); // Populate formatters. foreach (module_implements('field_formatter_info') as $module) { @@ -116,6 +118,7 @@ $info['formatter types'][$name]['module'] = $module; } } + drupal_alter('field_formatter_info', $info['formatter types']); // Populate information about 'fieldable' entities. foreach (module_implements('fieldable_info') as $module) { @@ -138,6 +141,7 @@ $info['fieldable types'][$name]['module'] = $module; } } + drupal_alter('fieldable_info', $info['fieldable types']); cache_set('field_info_types', $info, 'cache_field'); } Index: modules/field/field.crud.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.crud.inc,v retrieving revision 1.16 diff -u -r1.16 field.crud.inc --- modules/field/field.crud.inc 24 Jun 2009 18:16:38 -0000 1.16 +++ modules/field/field.crud.inc 25 Jun 2009 23:11:47 -0000 @@ -245,6 +245,7 @@ // Collect storage information. $schema = (array) module_invoke($field['module'], 'field_schema', $field); $schema += array('columns' => array(), 'indexes' => array()); + drupal_alter('field_schema', $schema, $field); // 'columns' are hardcoded in the field type. $field['columns'] = $schema['columns']; @@ -343,6 +344,8 @@ // Populate storage information. $schema = (array) module_invoke($field['module'], 'field_schema', $field); $schema += array('columns' => array(), 'indexes' => array()); + drupal_alter('field_schema', $schema, $field); + $field['columns'] = $schema['columns']; $field_name = $field['field_name']; Index: modules/field/field.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v retrieving revision 1.15 diff -u -r1.15 field.api.php --- modules/field/field.api.php 22 Jun 2009 09:10:04 -0000 1.15 +++ modules/field/field.api.php 25 Jun 2009 23:11:47 -0000 @@ -54,6 +54,16 @@ } /** + * Perform alterations on fieldable types. + * + * @param $info + * Array of informations on fieldable types exposed by hook_fieldable_info() + * implementations. + */ +function hook_fieldable_info_alter(&$info) { +} + +/** * @} End of "ingroup field_fieldable_type" */ @@ -115,6 +125,16 @@ } /** + * Perform alterations on Field API field types. + * + * @param $info + * Array of informations on widget types exposed by hook_field_info() + * implementations. + */ +function hook_field_info_alter(&$info) { +} + +/** * Define the Field API schema for a field structure. * * @param $field @@ -172,6 +192,18 @@ } /** + * Perform alterations on the schema for a field. + * + * @param $schema + * The schema information for the field, as returned by the field-type + * module's hook_field_schema(). + * @param $field + * The field structure whose schema is being collected. + */ +function hook_field_schema_alter(&$schema, $field) { +} + +/** * Define Field API widget types. * * @return @@ -186,6 +218,16 @@ function hook_field_widget_info() { } +/** + * Perform alterations on Field API widget types. + * + * @param $info + * Array of informations on widget types exposed by hook_field_widget_info() + * implementations. + */ +function hook_field_widget_info_alter(&$info) { +} + /* * Define Field API formatter types. * @@ -201,6 +243,16 @@ } /** + * Perform alterations on Field API formatter types. + * + * @param $info + * Array of informations on widget types exposed by + * hook_field_field_formatter_info() implementations. + */ +function hook_field_formatter_info_alter(&$info) { +} + +/** * Define custom load behavior for this module's field types. * * Unlike other field hooks, this hook operates on multiple objects. The