diff --git a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php index ef18122..e1317f8 100644 --- a/core/modules/system/src/Plugin/Block/SystemMenuBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemMenuBlock.php @@ -14,6 +14,7 @@ use Drupal\Core\Menu\MenuActiveTrailInterface; use Drupal\Core\Menu\MenuLinkTreeInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\Core\Url; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -232,10 +233,7 @@ public function getOperationLinks() { if ($this->moduleHandler->moduleExists('menu_ui')) { $links['menu-edit'] = [ 'title' => $this->t('Edit menu'), - 'route_name' => 'entity.menu.edit_form', - 'route_parameters' => [ - 'menu' => $menu, - ], + 'url' => Url::fromRoute('entity.menu.edit_form', ['menu' => $menu]), 'weight' => 50, ]; } diff --git a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php index 781d858..7f56ad3 100644 --- a/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php +++ b/core/modules/system/src/Tests/Block/SystemMenuBlockTest.php @@ -6,6 +6,7 @@ namespace Drupal\system\Tests\Block; use Drupal\Core\Render\Element; +use Drupal\Core\Url; use Drupal\simpletest\KernelTestBase; use Drupal\system\Tests\Routing\MockRouteProvider; use Drupal\Tests\Core\Menu\MenuLinkMock; @@ -192,11 +193,10 @@ public function testSystemMenuBlockConfigDependencies() { $links = $block->getOperationLinks(); $menu_link = [ 'title' => 'Edit menu', - 'route_name' => 'entity.menu.edit_form', - 'route_parameters' => ['menu' => $this->menu->id()], + 'url' => Url::fromRoute('entity.menu.edit_form', ['menu' => $this->menu->id()]), 'weight' => 50, ]; - $this->assertIdentical($links, ['menu-edit' => $menu_link]); + $this->assertEqual($links, ['menu-edit' => $menu_link]); } /**