diff --git a/core/lib/Drupal/Core/Annotation/Menu/LocalTask.php b/core/lib/Drupal/Core/Annotation/Menu/LocalTask.php index 52ef6a1..bb97814 100644 --- a/core/lib/Drupal/Core/Annotation/Menu/LocalTask.php +++ b/core/lib/Drupal/Core/Annotation/Menu/LocalTask.php @@ -40,6 +40,13 @@ class LocalTask extends Plugin { public $route_name; /** + * The route name. + * + * @var array + */ + public $route_parameters = array(); + + /** * The plugin ID of the root tab. * * @var array @@ -49,7 +56,7 @@ class LocalTask extends Plugin { /** * The plugin ID of the parent tab (or NULL for a top-level tab). * - * @var array|NULL + * @var string|NULL */ public $tab_parent_id; diff --git a/core/lib/Drupal/Core/Menu/LocalTaskBase.php b/core/lib/Drupal/Core/Menu/LocalTaskBase.php index b1cd894..6a09b56 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskBase.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskBase.php @@ -95,8 +95,8 @@ public function getRouteParameters(Request $request) { // then $request_raw_variables is array('node' => 2). $request_raw_variables = $request->attributes->get('_raw_variables'); foreach ($variables as $name) { - if (!isset($parameters[$name]) && isset($request_raw_variables[$name])) { - $parameters[$name] = $request_raw_variables[$name]; + if (!isset($parameters[$name]) && $request_raw_variables->has($name)) { + $parameters[$name] = $request_raw_variables->get($name); } } return $parameters; diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 973bccb..436ab96 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -206,28 +206,11 @@ function comment_menu() { 'title' => 'Comment permalink', 'route_name' => 'comment_permalink', ); - $items['comment/%comment/view'] = array( - 'title' => 'View comment', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - // Every other comment path uses %, but this one loads the comment directly, - // so we don't end up loading it twice (in the page and access callback). - $items['comment/%comment/edit'] = array( - 'title' => 'Edit', - 'type' => MENU_LOCAL_TASK, - 'route_name' => 'comment_edit_page', - ); $items['comment/%comment/approve'] = array( 'title' => 'Approve', 'weight' => 10, 'route_name' => 'comment_approve', ); - $items['comment/%comment/delete'] = array( - 'title' => 'Delete', - 'type' => MENU_LOCAL_TASK, - 'route_name' => 'comment_confirm_delete', - 'weight' => 20, - ); $items['comment/reply/%node'] = array( 'title' => 'Add new comment', 'page callback' => 'comment_reply', diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/CommentDeleteTask.php b/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/CommentDeleteTask.php new file mode 100644 index 0000000..265ec92 --- /dev/null +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Menu/LocalTask/CommentDeleteTask.php @@ -0,0 +1,25 @@ +xpath('//ul[contains(@class, "tabs")]//a[contains(@class, "active")]'); + $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]/a'); $this->assertEqual(1, count($result), 'There is just a single active tab.'); $this->assertEqual('View', (string) $result[0], 'The view tab is active.'); @@ -167,7 +167,7 @@ public function testPluginLocalTask() { 'menu-local-task-test/tasks/settings/sub2', ), 1); - $result = $this->xpath('//ul[contains(@class, "tabs")]//a[contains(@class, "active")]'); + $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]/a'); $this->assertEqual(1, count($result), 'There is just a single active tab.'); $this->assertEqual('Settings', (string) $result[0], 'The settings tab is active.'); @@ -178,7 +178,7 @@ public function testPluginLocalTask() { 'menu-local-task-test/tasks/settings/sub2', ), 1); - $result = $this->xpath('//ul[contains(@class, "tabs")]//a[contains(@class, "active")]'); + $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]/a'); $this->assertEqual(2, count($result), 'There are tabs active on both levels.'); $this->assertEqual('Settings', (string) $result[0], 'The settings tab is active.'); $this->assertEqual('sub1', (string) $result[1], 'The sub1 tab is active.');