From 19fa29c37b06d58f0b06b5232c8a3d1143c93641 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Fri, 24 Jan 2014 12:00:54 -0800
Subject: [PATCH] Issue #2181045 by tim.plunkett: Add a title callback for the
 term overview page.

---
 .../taxonomy/Controller/TaxonomyController.php     | 14 ++++++++++++++
 core/modules/taxonomy/taxonomy.module              |  6 ------
 core/modules/taxonomy/taxonomy.routing.yml         |  1 +
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php
index e79c37ce59fb..cf49ec64a5bd 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TaxonomyController.php
@@ -41,6 +41,20 @@ public function addForm(VocabularyInterface $taxonomy_vocabulary) {
   public function termPage(TermInterface $taxonomy_term) {
     module_load_include('pages.inc', 'taxonomy');
     return taxonomy_term_page($taxonomy_term);
+
+  }
+
+  /**
+   * Route title callback.
+   *
+   * @param \Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary
+   *   The taxonomy term.
+   *
+   * @return string
+   *   The term label.
+   */
+  public function vocabularyTitle(VocabularyInterface $taxonomy_vocabulary) {
+    return Xss::filter($taxonomy_vocabulary->label());
   }
 
   /**
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index e41b46770f48..fd0834443ab2 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -252,12 +252,6 @@ function taxonomy_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/structure/taxonomy/manage/%taxonomy_vocabulary'] = array(
-    'route_name' => 'taxonomy.overview_terms',
-    'title callback' => 'entity_page_label',
-    'title arguments' => array(4),
-  );
-
   return $items;
 }
 
diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml
index 804086001a0e..b5f3c2e96e40 100644
--- a/core/modules/taxonomy/taxonomy.routing.yml
+++ b/core/modules/taxonomy/taxonomy.routing.yml
@@ -79,6 +79,7 @@ taxonomy.overview_terms:
   path: '/admin/structure/taxonomy/manage/{taxonomy_vocabulary}'
   defaults:
     _form: 'Drupal\taxonomy\Form\OverviewTerms'
+    _title_callback: 'Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle'
   requirements:
     _entity_access: 'taxonomy_vocabulary.view'
 
-- 
GitLab