diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index 482659e..b4e9ee5 100644 --- a/core/modules/field/field.attach.inc +++ b/core/modules/field/field.attach.inc @@ -1311,6 +1311,7 @@ function field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { // Clear the cache. field_cache_clear(); + entity_info_cache_clear(); // Update bundle settings. $settings = variable_get('field_bundle_settings_' . $entity_type . '__' . $bundle_old, array()); diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 776b965..ab807dc 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -51,9 +51,7 @@ function field_ui_help($path, $arg) { */ function field_ui_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) { // The Field UI relies on entity_get_info() to build menu items for entity - // field administration pages. Clear the entity info cache and ensure that - // the menu is rebuilt. - entity_info_cache_clear(); + // field administration pages. Ensure that the menu is rebuilt. menu_rebuild(); } diff --git a/core/modules/field_ui/field_ui.test b/core/modules/field_ui/field_ui.test index 4bb7da9..adfd900 100644 --- a/core/modules/field_ui/field_ui.test +++ b/core/modules/field_ui/field_ui.test @@ -18,7 +18,9 @@ class FieldUITestCase extends DrupalWebTestCase { if (isset($modules[0]) && is_array($modules[0])) { $modules = $modules[0]; } + $modules[] = 'field_ui'; $modules[] = 'field_test'; + $modules[] = 'taxonomy'; parent::setUp($modules); // Create test user. @@ -134,6 +136,8 @@ class FieldUITestCase extends DrupalWebTestCase { * Tests the functionality of the 'Manage fields' screen. */ class FieldUIManageFieldsTestCase extends FieldUITestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( 'name' => 'Manage fields', @@ -149,6 +153,31 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase { $this->field_label = $this->randomName(8); $this->field_name_input = strtolower($this->randomName(8)); $this->field_name = 'field_'. $this->field_name_input; + + // Create Basic page and Article node types. + $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); + $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); + + // Create a vocabulary named "Tags". + $vocabulary = (object) array( + 'name' => 'Tags', + 'machine_name' => 'tags', + ); + taxonomy_vocabulary_save($vocabulary); + + $field = array( + 'field_name' => 'field_' . $vocabulary->machine_name, + 'type' => 'taxonomy_term_reference', + ); + field_create_field($field); + + $instance = array( + 'field_name' => 'field_' . $vocabulary->machine_name, + 'entity_type' => 'node', + 'label' => 'Tags', + 'bundle' => 'article', + ); + field_create_instance($instance); } /**