? .git ? .gitignore ? 937442-2_maintain_field_schema.patch ? 937554-1_cleanup_field_data.patch ? drupal.field-update.0.patch Index: modules/field/field.crud.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.crud.inc,v retrieving revision 1.71 diff -u -p -r1.71 field.crud.inc --- modules/field/field.crud.inc 29 Sep 2010 01:37:02 -0000 1.71 +++ modules/field/field.crud.inc 10 Oct 2010 17:50:12 -0000 @@ -465,12 +465,25 @@ function field_update_field($field) { // The serialized 'data' column contains everything from $field that does not // have its own column and is not automatically populated when the field is // read. - $data = $field; - unset($data['columns'], $data['field_name'], $data['type'], $data['locked'], $data['module'], $data['cardinality'], $data['active'], $data['deleted']); - // Additionally, do not save the 'bundles' property populated by - // field_info_field(). - unset($data['bundles']); - + $keys = array( + // Ignore {field_config} keys. + 'id', 'field_name', 'type', 'module', 'active', 'locked', 'cardinality', + 'translatable', 'deleted', + // Ignore all possible storage engine keys. + 'storage', 'storage_type', 'storage_module', 'storage_active', + // Ignore the data key itself. + 'data', + // Ignore field schema keys. + // @todo Right now, this is the only way to make this function work like it + // is supposed to work. I.e., without copying field schema information + // into the serialized 'data' column, subsequent invocations of + // field_update_field() are failing, since field_read_fields() retrieves + // the current hook_field_schema(), so there is *nothing* to update. + //'columns', 'primary key', 'unique keys', 'indexes', 'foreign keys', + // Ignore field_info_field() properties. + 'bundles', + ); + $data = array_diff_key($field, array_flip($keys)); $field['data'] = $data; // Store the field and create the id. Index: modules/field/field.info.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.info.inc,v retrieving revision 1.53 diff -u -p -r1.53 field.info.inc --- modules/field/field.info.inc 11 Sep 2010 00:03:42 -0000 1.53 +++ modules/field/field.info.inc 10 Oct 2010 17:50:12 -0000 @@ -255,7 +255,9 @@ function _field_info_collate_fields($res */ function _field_info_prepare_field($field) { // Make sure all expected field settings are present. + $field += array('settings' => array()); $field['settings'] += field_info_field_settings($field['type']); + $field['storage'] += array('settings' => array()); $field['storage']['settings'] += field_info_storage_settings($field['storage']['type']); // Add storage details.