From f07bcffad6aec9f4dc2745055846689f52c53bc5 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 16 Mar 2015 13:49:11 -0700 Subject: [PATCH] Issue #2449743 by root_brute, tstoeckler: SwitchShortcutSet has an unnecessary dependency on the route match --- .../shortcut/src/Form/SwitchShortcutSet.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/core/modules/shortcut/src/Form/SwitchShortcutSet.php b/core/modules/shortcut/src/Form/SwitchShortcutSet.php index 0efa824273b..53d5d8e32df 100644 --- a/core/modules/shortcut/src/Form/SwitchShortcutSet.php +++ b/core/modules/shortcut/src/Form/SwitchShortcutSet.php @@ -35,24 +35,14 @@ class SwitchShortcutSet extends FormBase { */ protected $shortcutSetStorage; - /** - * The current route match. - * - * @var \Drupal\Core\Routing\RouteMatchInterface - */ - protected $routeMatch; - /** * Constructs a SwitchShortcutSet object. * * @param \Drupal\shortcut\ShortcutSetStorageInterface $shortcut_set_storage * The shortcut set storage. - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The current route match. */ - public function __construct(ShortcutSetStorageInterface $shortcut_set_storage, RouteMatchInterface $route_match) { + public function __construct(ShortcutSetStorageInterface $shortcut_set_storage) { $this->shortcutSetStorage = $shortcut_set_storage; - $this->routeMatch = $route_match; } /** @@ -60,8 +50,7 @@ class SwitchShortcutSet extends FormBase { */ public static function create(ContainerInterface $container) { return new static( - $container->get('entity.manager')->getStorage('shortcut_set'), - $container->get('current_route_match') + $container->get('entity.manager')->getStorage('shortcut_set') ); } @@ -196,7 +185,7 @@ class SwitchShortcutSet extends FormBase { $replacements = array( '%user' => $this->user->label(), '%set_name' => $set->label(), - '@switch-url' => $this->url($this->routeMatch->getRouteName(), array('user' => $this->user->id())), + '@switch-url' => $this->url(''), ); if ($account_is_user) { // Only administrators can create new shortcut sets, so we know they have