Commit 1ab8967d authored by JeroenT's avatar JeroenT Committed by Berdir
Browse files

Issue #3088811 by JeroenT, Berdir: Local tasks are no longer present on Drupal 8.8.x

parent ae57b09a
pathauto.patterns.form:
route_name: entity.pathauto_pattern.collection
base_route: path.admin_overview
base_route: entity.path_alias.collection
title: 'Patterns'
weight: 10
pathauto.settings.form:
route_name: pathauto.settings.form
base_route: path.admin_overview
base_route: entity.path_alias.collection
title: 'Settings'
weight: 20
pathauto.bulk.update.form:
route_name: pathauto.bulk.update.form
base_route: path.admin_overview
base_route: entity.path_alias.collection
title: 'Bulk generate'
weight: 30
pathauto.admin.delete:
route_name: pathauto.admin.delete
base_route: path.admin_overview
base_route: entity.path_alias.collection
title: 'Delete aliases'
weight: 40
......@@ -172,3 +172,16 @@ function pathauto_pattern_validate($element, FormStateInterface $form_state) {
return $element;
}
/**
* Implements hook_local_tasks_alter().
*/
function pathauto_local_tasks_alter(&$local_tasks) {
if (version_compare(\Drupal::VERSION, '8.8', '<')) {
foreach ($local_tasks as &$local_task) {
if ($local_task['provider'] === 'pathauto') {
$local_task['base_route'] = 'path.admin_overview';
}
}
}
}
......@@ -21,7 +21,7 @@ class PathautoUiTest extends WebDriverTestBase {
*
* @var array
*/
public static $modules = ['pathauto', 'node'];
public static $modules = ['pathauto', 'node', 'block'];
/**
* Admin user.
......@@ -63,7 +63,18 @@ class PathautoUiTest extends WebDriverTestBase {
}
function testPatternsWorkflow() {
$this->drupalGet('admin/config/search/path/patterns/add');
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('local_actions_block');
$this->drupalPlaceBlock('page_title_block');
$this->drupalGet('admin/config/search/path');
$this->assertSession()->elementContains('css', '.block-local-tasks-block', 'Patterns');
$this->assertSession()->elementContains('css', '.block-local-tasks-block', 'Settings');
$this->assertSession()->elementContains('css', '.block-local-tasks-block', 'Bulk generate');
$this->assertSession()->elementContains('css', '.block-local-tasks-block', 'Delete aliases');
$this->drupalGet('admin/config/search/path/patterns');
$this->clickLink('Add Pathauto pattern');
$session = $this->getSession();
$session->getPage()->fillField('type', 'canonical_entities:node');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment