Commit 1bb6e13d authored by Dries's avatar Dries
Browse files

- Patch #762604 by andypost: taxonomy terms list broken, term add/edit forgets it's parent.

parent fcb8df3c
......@@ -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;
......
......@@ -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.
......
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