diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php index 1f34e66..1ba5e2d 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php @@ -488,4 +488,31 @@ class TermTest extends TaxonomyTestBase { $terms = taxonomy_term_load_multiple_by_name($term2->name, 'non_existing_vocabulary'); $this->assertEqual(count($terms), 0, 'No terms loaded when restricted by a non-existing vocabulary.'); } + + /** + * Tests that editing and saving a node with no changes works correctly. + */ + function testReSavingTags() { + // Enable tags in the vocabulary. + $instance = $this->instance; + $instance['widget'] = array('type' => 'taxonomy_autocomplete'); + field_update_instance($instance); + + // Create a term and a node using it. + $term = $this->createTerm($this->vocabulary); + $langcode = LANGUAGE_NOT_SPECIFIED; + $edit = array(); + $edit["title"] = $this->randomName(8); + $edit["body[$langcode][0][value]"] = $this->randomName(16); + $edit[$this->instance['field_name'] . '[' . $langcode . ']'] = $term->name; + $this->drupalPost('node/add/article', $edit, t('Save')); + + // Check that the term is displayed when editing and saving the node with no + // changes. + $this->clickLink(t('Edit')); + $this->assertText($term->name, 'Term is displayed when editing the node.'); + $this->drupalPost(NULL, array(), t('Save')); + $this->assertText($term->name, 'Term is displayed after saving the node with no changes.'); + } + }