diff --git a/core/modules/taxonomy/src/Controller/TaxonomyController.php b/core/modules/taxonomy/src/Controller/TaxonomyController.php index 27b1ec0c86..8ffdb6cffe 100644 --- a/core/modules/taxonomy/src/Controller/TaxonomyController.php +++ b/core/modules/taxonomy/src/Controller/TaxonomyController.php @@ -34,8 +34,15 @@ public function addForm(VocabularyInterface $taxonomy_vocabulary) { * * @return string * The vocabulary label as a render array. + * + * @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. + * Use Drupal\Core\Entity\Controller\EntityController instead. + * + * @see \Drupal\Core\Entity\Controller\EntityController::title() + * @see https://www.drupal.org/node/2924909 */ public function vocabularyTitle(VocabularyInterface $taxonomy_vocabulary) { + @trigger_error('TaxonomyController::vocabularyTitle() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Instead, you should use Drupal\Core\Entity\Controller\EntityController::title(). See https://www.drupal.org/node/2924909.', E_USER_DEPRECATED); return ['#markup' => $taxonomy_vocabulary->label(), '#allowed_tags' => Xss::getHtmlTagList()]; } diff --git a/core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php b/core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php index 56a93dc143..70f1118051 100644 --- a/core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php +++ b/core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php @@ -66,7 +66,7 @@ protected function getResetPageRoute(EntityTypeInterface $entity_type) { */ protected function getOverviewPageRoute(EntityTypeInterface $entity_type) { $route = new Route('/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/overview'); - $route->setDefault('_title_callback', 'Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle'); + $route->setDefault('_title_callback', 'Drupal\Core\Entity\Controller\EntityController::title'); $route->setDefault('_form', 'Drupal\taxonomy\Form\OverviewTerms'); $route->setRequirement('_entity_access', 'taxonomy_vocabulary.access taxonomy overview'); $route->setOption('_admin_route', TRUE);