diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index df21f69..880dfd9 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('Edit General discussion in Forums vocabulary', '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..06e8e4a 100644
--- a/core/modules/taxonomy/src/TermForm.php
+++ b/core/modules/taxonomy/src/TermForm.php
@@ -4,6 +4,7 @@
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
+use Drupal\taxonomy\Entity\Vocabulary;
/**
* Base for handler for taxonomy term edit forms.
@@ -15,6 +16,12 @@ class TermForm extends ContentEntityForm {
*/
public function form(array $form, FormStateInterface $form_state) {
$term = $this->entity;
+
+ if (!$term->isNew()) {
+ $vocabulary = Vocabulary::load($term->bundle());
+ $form['#title'] = $this->t('Edit @name in @parent vocabulary', array('@name' => $term->label(), '@parent' => $vocabulary->label()));
+ }
+
$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/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index 403c28c..770a4fb 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -325,6 +325,8 @@ function testTermInterface() {
$this->clickLink(t('Edit'));
+ $this->assertText('Edit ' . $edit['name[0][value]'] . ' in ' . $this->vocabulary->label() . ' vocabulary', 'Page title string contains term and vocabulary name.');
+
$this->assertRaw($edit['name[0][value]'], 'The randomly generated term name is present.');
$this->assertText($edit['description[0][value]'], 'The randomly generated term description is present.');
diff --git a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
index 76fcac2..501f9bc 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
+++ b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
@@ -51,6 +51,7 @@ function testVocabularyInterface() {
$this->assertText($edit['description'], 'Vocabulary description found in the vocabulary overview listing.');
$this->assertLinkByHref(Url::fromRoute('entity.taxonomy_term.add_form', ['taxonomy_vocabulary' => $edit['vid']])->toString());
$this->clickLink(t('Edit vocabulary'));
+ $this->assertRaw('Edit ' . $edit['name'], 'Page title string is formatted and contains vocabulary name.');
$edit = array();
$edit['name'] = $this->randomMachineName();
$edit['description'] = $this->randomMachineName();
diff --git a/core/modules/taxonomy/src/VocabularyForm.php b/core/modules/taxonomy/src/VocabularyForm.php
index 1868ddc..7886458 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(