From 13ce7999afc3c346de1d75f6862935ff0c015fc3 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Sun, 13 Oct 2013 13:42:40 +0100 Subject: [PATCH] Issue #2102461 by InternetDevels, vijaycs85: Remove drupal_set_title() in menu module controllers. --- core/modules/menu/lib/Drupal/menu/Controller/MenuController.php | 2 -- core/modules/menu/lib/Drupal/menu/MenuFormController.php | 2 +- core/modules/menu/menu.routing.yml | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php index 6beeedf97b01..83e5646c9030 100644 --- a/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php +++ b/core/modules/menu/lib/Drupal/menu/Controller/MenuController.php @@ -88,8 +88,6 @@ class MenuController implements ContainerInjectionInterface { * Returns the menu link submission form. */ public function addLink(MenuInterface $menu) { - // @todo Remove this when https://drupal.org/node/1981644 is in. - drupal_set_title(t('Add menu link')); $menu_link = $this->menuLinkStorage->create(array( 'mlid' => 0, 'plid' => 0, diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php index 68bc6a48d58f..8d9ca2612b79 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php @@ -70,7 +70,7 @@ class MenuFormController extends EntityFormController { $menu = $this->entity; if ($this->operation == 'edit') { - drupal_set_title(t('Edit menu %label', array('%label' => $menu->label())), PASS_THROUGH); + $form['#title'] = $this->t('Edit menu %label', array('%label' => $menu->label())); } $form['label'] = array( diff --git a/core/modules/menu/menu.routing.yml b/core/modules/menu/menu.routing.yml index a3a65aaeb3ae..25c1f5375361 100644 --- a/core/modules/menu/menu.routing.yml +++ b/core/modules/menu/menu.routing.yml @@ -24,6 +24,7 @@ menu.link_add: path: '/admin/structure/menu/manage/{menu}/add' defaults: _content: '\Drupal\menu\Controller\MenuController::addLink' + _title: 'Add menu link' requirements: _entity_create_access: 'menu_link'