diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-12 00:50:52 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-12 00:50:52 -0700 |
commit | e22feb71235729868069fbe862e804d66369d335 (patch) | |
tree | 77d422740ad03bbb199bf1be83d27e3d62206dd8 /modules/field/field.attach.inc | |
parent | 84194b38e368beec5acecee825d4ee3d01bf53a6 (diff) | |
download | brdo-e22feb71235729868069fbe862e804d66369d335.tar.gz brdo-e22feb71235729868069fbe862e804d66369d335.tar.bz2 |
Issue #1211008 by yched, tim.plunkett, DamienMcKenna: Split field_bundle_settings() out per bundle.
Diffstat (limited to 'modules/field/field.attach.inc')
-rw-r--r-- | modules/field/field.attach.inc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index a5a1e8e89..36117eb7a 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -1321,12 +1321,9 @@ function field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { field_cache_clear(); // Update bundle settings. - $settings = variable_get('field_bundle_settings', array()); - if (isset($settings[$entity_type][$bundle_old])) { - $settings[$entity_type][$bundle_new] = $settings[$entity_type][$bundle_old]; - unset($settings[$entity_type][$bundle_old]); - variable_set('field_bundle_settings', $settings); - } + $settings = variable_get('field_bundle_settings_' . $entity_type . '__' . $bundle_old, array()); + variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle_new, $settings); + variable_del('field_bundle_settings_' . $entity_type . '__' . $bundle_old); // Let other modules act on renaming the bundle. module_invoke_all('field_attach_rename_bundle', $entity_type, $bundle_old, $bundle_new); @@ -1360,11 +1357,7 @@ function field_attach_delete_bundle($entity_type, $bundle) { field_cache_clear(); // Clear bundle display settings. - $settings = variable_get('field_bundle_settings', array()); - if (isset($settings[$entity_type][$bundle])) { - unset($settings[$entity_type][$bundle]); - variable_set('field_bundle_settings', $settings); - } + variable_del('field_bundle_settings_' . $entity_type . '__' . $bundle); // Let other modules act on deleting the bundle. module_invoke_all('field_attach_delete_bundle', $entity_type, $bundle, $instances); |