diff --git modules/taxonomy/taxonomy.admin.inc modules/taxonomy/taxonomy.admin.inc index e81eebb..15dd7a1 100644 --- modules/taxonomy/taxonomy.admin.inc +++ modules/taxonomy/taxonomy.admin.inc @@ -161,11 +161,9 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) { '#title' => t('Description'), '#default_value' => $vocabulary->description, ); - // Set the hierarchy to "multiple parents" by default. This simplifies the - // vocabulary form and standardizes the term form. $form['hierarchy'] = array( '#type' => 'value', - '#value' => '0', + '#value' => $vocabulary->hierarchy, ); $form['actions'] = array('#type' => 'actions'); diff --git modules/taxonomy/taxonomy.test modules/taxonomy/taxonomy.test index c622d6a..e289abf 100644 --- modules/taxonomy/taxonomy.test +++ modules/taxonomy/taxonomy.test @@ -460,6 +460,14 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { taxonomy_term_save($term2); $parents = taxonomy_get_parents($term2->tid); $this->assertTrue(isset($parents[$term1->tid]) && isset($parents[$term3->tid]), t('Both parents found successfully.')); + // Regression test for http://drupal.org/node/353775 + $vocab = end(entity_load('taxonomy_vocabulary', array($this->vocabulary->vid), array(), TRUE)); + $this->assertEqual($vocab->hierarchy, 1, 'Vocabulary is marked as hierarchical.'); + // Edit the vocabulary. This should not change the hierarchy value. + $edit = array(); + $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/edit', $edit, t('Save')); + $vocab = end(entity_load('taxonomy_vocabulary', array($this->vocabulary->vid), array(), TRUE)); + $this->assertEqual($vocab->hierarchy, 1, 'Vocabulary is marked as hierarchical.'); } /**