From 1a600fed66846db37426ce98ba9705c9e526bade Mon Sep 17 00:00:00 2001 From: Ovidiu Bokar Date: Wed, 23 Nov 2016 17:24:58 +0000 Subject: [PATCH] added bundle into term edit title --- core/modules/forum/src/Tests/ForumTest.php | 4 ++-- core/modules/taxonomy/src/TermForm.php | 5 +++++ core/modules/taxonomy/src/VocabularyForm.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index df21f69..9dbe121 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -301,13 +301,13 @@ private function doAdminTests($user) { $this->assertLink('Add forum'); $this->assertLink('Add container'); $this->clickLink('edit container'); - $this->assertRaw('Edit container', 'Followed the link to edit the container'); + $this->assertRaw('Edit ' . $this->forumContainer['name'], 'Followed the link to edit the container'); // Create forum inside the forum container. $this->forum = $this->createForum('forum', $this->forumContainer['tid']); // Verify the "edit forum" link exists and functions correctly. $this->drupalGet('admin/structure/forum'); $this->clickLink('edit forum'); - $this->assertRaw('Edit forum', 'Followed the link to edit the forum'); + $this->assertRaw($this->forum['name'], 'Followed the link to edit the forum'); // Navigate back to forum structure page. $this->drupalGet('admin/structure/forum'); // Create second forum in container, destined to be deleted below. diff --git a/core/modules/taxonomy/src/TermForm.php b/core/modules/taxonomy/src/TermForm.php index 1f56351..b0d5afe 100644 --- a/core/modules/taxonomy/src/TermForm.php +++ b/core/modules/taxonomy/src/TermForm.php @@ -15,6 +15,11 @@ class TermForm extends ContentEntityForm { */ public function form(array $form, FormStateInterface $form_state) { $term = $this->entity; + + if (!$term->isNew()) { + $form['#title'] = $this->t('Edit @name in @parent vocabulary', array('@name' => $term->label(),'@parent' => $term->bundle())); + } + $vocab_storage = $this->entityManager->getStorage('taxonomy_vocabulary'); $taxonomy_storage = $this->entityManager->getStorage('taxonomy_term'); $vocabulary = $vocab_storage->load($term->bundle()); diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php index 1868ddc..dcab503 100644 --- a/core/modules/taxonomy/src/VocabularyForm.php +++ b/core/modules/taxonomy/src/VocabularyForm.php @@ -49,7 +49,7 @@ public function form(array $form, FormStateInterface $form_state) { $form['#title'] = $this->t('Add vocabulary'); } else { - $form['#title'] = $this->t('Edit vocabulary'); + $form['#title'] = $this->t('Edit @name', array('@name' => $vocabulary->label())); } $form['name'] = array( -- 2.3.8 (Apple Git-58)