Commit 231ad0db authored by catch's avatar catch

Issue #1375452 by sun, beejeebus: Fixed Renaming a content type bundle causes...

Issue #1375452 by sun, beejeebus: Fixed Renaming a content type bundle causes notices on manage fields page.
parent 65a31d68
......@@ -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());
......
......@@ -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();
}
......
......@@ -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);
}
/**
......
......@@ -228,6 +228,7 @@ function node_entity_info() {
// Bundles must provide a human readable name so we can create help and error
// messages, and the path to attach Field admin pages to.
node_type_cache_reset();
foreach (node_type_get_names() as $type => $name) {
$return['node']['bundles'][$type] = array(
'label' => $name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment