-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_vocabulary-1906244-4.patch
39 lines (36 loc) · 1.68 KB
/
show_vocabulary-1906244-4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index 828fde0..d728d1e 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -675,6 +675,16 @@ function taxonomy_form_term($form, &$form_state, $edit = array(), $vocabulary =
return array_merge($form, taxonomy_term_confirm_delete($form, $form_state, $term->tid));
}
+ if (!empty($term->name)) {
+ $form['vocabulary'] = array(
+ '#markup' => '<b>' . t('Vocabulary') . ':</b> ' . l($vocabulary->name, 'admin/structure/taxonomy/' . $vocabulary->machine_name),
+ '#weight' => -6,
+ );
+ $breadcrumb[] = l(t('Home'), NULL);
+ $breadcrumb[] = l($vocabulary->name, 'admin/structure/taxonomy/' . $vocabulary->machine_name);
+ $breadcrumb[] = l($term->name, 'taxonomy/term/' . $term->tid);
+ drupal_set_breadcrumb($breadcrumb);
+ }
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index 123bdce..6243dd4 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -803,6 +803,13 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
// the first edit link found on the listing page is to our term.
$this->clickLink(t('edit'));
+ // Test vocabulary link.
+ $this->clickLink($this->vocabulary->name);
+ $this->assertLink(t('Add term'));
+
+ // Go back to term page.
+ $this->clickLink(t('edit'));
+
$this->assertRaw($edit['name'], 'The randomly generated term name is present.');
$this->assertText($edit['description[value]'], 'The randomly generated term description is present.');