diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-06 05:44:07 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-06 05:44:07 +0000 |
commit | 1bb6e13d7893704d5cf73ef3d8447bf9695a83be (patch) | |
tree | 16d5455ec71c8861d4bd8821e1d428c98bcd65fb /modules/taxonomy | |
parent | fcb8df3c7768b3da2b434e6310fc529b7cd79e4b (diff) | |
download | brdo-1bb6e13d7893704d5cf73ef3d8447bf9695a83be.tar.gz brdo-1bb6e13d7893704d5cf73ef3d8447bf9695a83be.tar.bz2 |
- Patch #762604 by andypost: taxonomy terms list broken, term add/edit forgets it's parent.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 3 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.test | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 7e6b43268..8579f7442 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -686,6 +686,9 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary = $tree = taxonomy_get_tree($vocabulary->vid); $options = array('<' . t('root') . '>'); + if (empty($parent)) { + $parent = array(0); + } foreach ($tree as $term) { if (!in_array($term->tid, $exclude)) { $options[$term->tid] = str_repeat('-', $term->depth) . $term->name; diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index aa8b98335..a9b574c19 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -486,12 +486,17 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { // Edit the term. $this->drupalPost('taxonomy/term/' . $term->tid . '/edit', $edit, t('Save')); + // Check that the term is still present at admin UI after edit. + $this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name); + $this->assertText($edit['name'], t('The randomly generated term name is present.')); + $this->assertLink(t('edit')); + // View the term and check that it is correct. $this->drupalGet('taxonomy/term/' . $term->tid); $this->assertText($edit['name'], t('The randomly generated term name is present.')); $this->assertText($edit['description[value]'], t('The randomly generated term description is present.')); - // Check that term feed page is working + // Check that the term feed page is working. $this->drupalGet('taxonomy/term/' . $term->tid . '/feed'); // Delete the term. |