diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-01-02 15:00:34 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-01-02 15:00:34 +0000 |
commit | b12d812b9397609a5853d8c2b73f29d282496fd9 (patch) | |
tree | cf6de6724ccba65a56aa3d73f6bf554ccc3c0313 /modules/field_ui/field_ui.module | |
parent | 89028a43bbbaf73e6aa1e8e00bc12d46d1fc7119 (diff) | |
download | brdo-b12d812b9397609a5853d8c2b73f29d282496fd9.tar.gz brdo-b12d812b9397609a5853d8c2b73f29d282496fd9.tar.bz2 |
- Patch #665878 by yched: fixed field_extra_fields()
Diffstat (limited to 'modules/field_ui/field_ui.module')
-rw-r--r-- | modules/field_ui/field_ui.module | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module index b24ef7776..155849bce 100644 --- a/modules/field_ui/field_ui.module +++ b/modules/field_ui/field_ui.module @@ -248,7 +248,7 @@ function field_ui_field_ui_view_modes_tabs() { /** * Implements hook_field_attach_create_bundle(). */ -function field_ui_field_attach_create_bundle($bundle) { +function field_ui_field_attach_create_bundle($obj_type, $bundle) { // When a new bundle is created, the menu needs to be rebuilt to add our // menu item tabs. variable_set('menu_rebuild_needed', TRUE); @@ -257,18 +257,26 @@ function field_ui_field_attach_create_bundle($bundle) { /** * Implements hook_field_attach_rename_bundle(). */ -function field_ui_field_attach_rename_bundle($bundle_old, $bundle_new) { - if ($bundle_old !== $bundle_new && $extra = variable_get("field_extra_weights_$bundle_old", array())) { - variable_set("field_extra_weights_$bundle_new", $extra); - variable_del("field_extra_weights_$bundle_old"); +function field_ui_field_attach_rename_bundle($obj_type, $bundle_old, $bundle_new) { + if ($bundle_old !== $bundle_new) { + $extra_weights = variable_get('field_extra_weights', array()); + if (isset($info[$obj_type][$bundle_old])) { + $extra_weights[$obj_type][$bundle_new] = $extra_weights[$obj_type][$bundle_old]; + unset($extra_weights[$obj_type][$bundle_old]); + variable_set('field_extra_weights', $extra_weights); + } } } /** * Implements hook_field_attach_delete_bundle(). */ -function field_ui_field_attach_delete_bundle($bundle) { - variable_del('field_extra_weights_' . $bundle); +function field_ui_field_attach_delete_bundle($obj_type, $bundle) { + $extra_weights = variable_get('field_extra_weights', array()); + if (isset($extra_weights[$obj_type][$bundle])) { + unset($extra_weights[$obj_type][$bundle]); + variable_set('field_extra_weights', $extra_weights); + } } /** |