diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php index f740cb8..a82a1fa 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php @@ -137,7 +137,6 @@ function testTaxonomyTermFieldWidgets() { /** * Tests that vocabulary machine name changes are mirrored in field definitions. */ -/* function testTaxonomyTermFieldChangeMachineName() { // Add several entries in the 'allowed_values' setting, to make sure that // they all get updated. @@ -168,5 +167,4 @@ function testTaxonomyTermFieldChangeMachineName() { $this->assertEqual($allowed_values[1]['vocabulary'], $new_name, 'Index 1: Machine name was updated correctly.'); $this->assertEqual($allowed_values[2]['vocabulary'], 'foo', 'Index 2: Machine name was left untouched.'); } -*/ } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php index 6c4ca23..b66da01 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php @@ -147,7 +147,7 @@ function testTaxonomyVocabularyLoadMultiple() { /** * Tests that machine name changes are properly reflected. - * + */ function testTaxonomyVocabularyChangeMachineName() { // Add a field instance to the vocabulary. $field = array( @@ -175,7 +175,7 @@ function testTaxonomyVocabularyChangeMachineName() { // Check that the field instance is still attached to the vocabulary. $this->assertTrue(field_info_instance('taxonomy_term', 'field_test', $new_name), 'The bundle name was updated correctly.'); - }*/ + } /** * Test uninstall and reinstall of the taxonomy module. diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php index cd096b6..2ff20cf 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php @@ -27,15 +27,15 @@ protected function postSave(EntityInterface $entity, $update) { // fields. $fields = field_read_fields(); foreach ($fields as $field_name => $field) { - $update = FALSE; + $update_field = FALSE; if ($field['type'] == 'taxonomy_term_reference') { foreach ($field['settings']['allowed_values'] as $key => &$value) { if ($value['vocabulary'] == $entity->getOriginalID()) { $value['vocabulary'] = $entity->id(); - $update = TRUE; + $update_field = TRUE; } } - if ($update) { + if ($update_field) { field_update_field($field); } } @@ -100,6 +100,7 @@ protected function postDelete($entities) { public function resetCache(array $ids = NULL) { drupal_static_reset('taxonomy_vocabulary_get_names'); parent::resetCache($ids); - cache_invalidate(array('content' => TRUE)); + cache_invalidate(array('content' => TRUE, 'entity_info' => TRUE)); + drupal_static_reset('entity_get_info'); } }