Skip to content
Snippets Groups Projects
Commit 13ce7999 authored by catch's avatar catch
Browse files

Issue #2102461 by InternetDevels, vijaycs85: Remove drupal_set_title() in menu module controllers.

parent c63dd209
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -88,8 +88,6 @@ public function getParentOptions(Request $request) { ...@@ -88,8 +88,6 @@ public function getParentOptions(Request $request) {
* Returns the menu link submission form. * Returns the menu link submission form.
*/ */
public function addLink(MenuInterface $menu) { 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( $menu_link = $this->menuLinkStorage->create(array(
'mlid' => 0, 'mlid' => 0,
'plid' => 0, 'plid' => 0,
......
...@@ -70,7 +70,7 @@ public function form(array $form, array &$form_state) { ...@@ -70,7 +70,7 @@ public function form(array $form, array &$form_state) {
$menu = $this->entity; $menu = $this->entity;
if ($this->operation == 'edit') { 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( $form['label'] = array(
......
...@@ -24,6 +24,7 @@ menu.link_add: ...@@ -24,6 +24,7 @@ menu.link_add:
path: '/admin/structure/menu/manage/{menu}/add' path: '/admin/structure/menu/manage/{menu}/add'
defaults: defaults:
_content: '\Drupal\menu\Controller\MenuController::addLink' _content: '\Drupal\menu\Controller\MenuController::addLink'
_title: 'Add menu link'
requirements: requirements:
_entity_create_access: 'menu_link' _entity_create_access: 'menu_link'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment