summaryrefslogtreecommitdiff
path: root/modules/field
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-15 22:18:35 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-15 22:18:35 +0000
commitbfe2c14b54be1f1b85c5c4b3d2007e8d93531438 (patch)
treebf983a4d1197cccdb88df308c610ae20f9d78a7c /modules/field
parentfa54a703da4d15d8a740bef4c1bb4ba49f4c14f6 (diff)
downloadbrdo-bfe2c14b54be1f1b85c5c4b3d2007e8d93531438.tar.gz
brdo-bfe2c14b54be1f1b85c5c4b3d2007e8d93531438.tar.bz2
#706962 by yched: Fixed No way to remove field instance from a bundle without removing instance from all bundles.
Diffstat (limited to 'modules/field')
-rw-r--r--modules/field/field.crud.inc7
-rw-r--r--modules/field/field.info.inc3
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc
index 976e1ffd3..80772279f 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -319,6 +319,9 @@ function field_create_field($field) {
// read.
$data = $field;
unset($data['columns'], $data['field_name'], $data['type'], $data['active'], $data['module'], $data['storage_type'], $data['storage_active'], $data['storage_module'], $data['locked'], $data['cardinality'], $data['deleted']);
+ // Additionally, do not save the 'bundles' property populated by
+ // field_info_field().
+ unset($data['bundles']);
$record = array(
'field_name' => $field['field_name'],
@@ -440,6 +443,10 @@ function field_update_field($field) {
// 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']);
+
$field['data'] = $data;
// Store the field and create the id.
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc
index 5e72b9339..1e949b6c7 100644
--- a/modules/field/field.info.inc
+++ b/modules/field/field.info.inc
@@ -248,6 +248,9 @@ function _field_info_prepare_field($field) {
drupal_alter('field_storage_details', $details, $field, $instance);
$field['storage']['details'] = $details;
+ // Initialize the 'bundles' list.
+ $field['bundles'] = array();
+
return $field;
}