Skip to content
Snippets Groups Projects
Commit 235a1628 authored by Ted Bowman's avatar Ted Bowman Committed by Adam G-H
Browse files

Issue #3238852 by tedbow, phenaproxima: Alter the existing "update" tabs use our routes

parent 4df12ef6
No related branches found
No related tags found
1 merge request!52Issue #3238852: Remove the update modules "update" tab because it does support a composer workflow
automatic_updates.report_update:
route_name: automatic_updates.report_update
base_route: system.admin_reports
title: Automatic Updates
weight: 15
automatic_updates.module_update:
route_name: automatic_updates.module_update
base_route: system.modules_list
title: Automatic Updates
weight: 15
...@@ -84,3 +84,22 @@ function automatic_updates_form_update_manager_update_form_alter(&$form, FormSta ...@@ -84,3 +84,22 @@ function automatic_updates_form_update_manager_update_form_alter(&$form, FormSta
} }
} }
} }
/**
* Implements hook_local_tasks_alter().
*/
function automatic_updates_local_tasks_alter(array &$local_tasks) {
// The Update module's update form only allows updating modules and themes
// via archive files, which could produce unexpected results on a site using
// our Composer-based updater.
$new_routes = [
'update.report_update' => 'automatic_updates.report_update',
'update.module_update' => 'automatic_updates.module_update',
'update.theme_update' => 'automatic_updates.theme_update',
];
foreach ($new_routes as $local_task_id => $new_route) {
if (!empty($local_tasks[$local_task_id])) {
$local_tasks[$local_task_id]['route_name'] = $new_route;
}
}
}
...@@ -33,3 +33,12 @@ automatic_updates.module_update: ...@@ -33,3 +33,12 @@ automatic_updates.module_update:
_permission: 'administer software updates' _permission: 'administer software updates'
options: options:
_admin_route: TRUE _admin_route: TRUE
automatic_updates.theme_update:
path: '/admin/theme/automatic-update'
defaults:
_form: '\Drupal\automatic_updates\Form\UpdaterForm'
_title: 'Update'
requirements:
_permission: 'administer software updates'
options:
_admin_route: TRUE
...@@ -120,7 +120,7 @@ class CoreUpdateTest extends UpdateTestBase { ...@@ -120,7 +120,7 @@ class CoreUpdateTest extends UpdateTestBase {
$assert_session = $mink->assertSession(); $assert_session = $mink->assertSession();
$this->visit('/admin/modules'); $this->visit('/admin/modules');
$assert_session->pageTextContains('There is a security update available for your version of Drupal.'); $assert_session->pageTextContains('There is a security update available for your version of Drupal.');
$page->clickLink('Automatic Updates'); $page->clickLink('Update');
$assert_session->pageTextNotContains('There is a security update available for your version of Drupal.'); $assert_session->pageTextNotContains('There is a security update available for your version of Drupal.');
$page->pressButton('Update'); $page->pressButton('Update');
$this->waitForBatchJob(); $this->waitForBatchJob();
......
...@@ -99,8 +99,6 @@ class UpdaterFormTest extends BrowserTestBase { ...@@ -99,8 +99,6 @@ class UpdaterFormTest extends BrowserTestBase {
$this->clickLink('Extend'); $this->clickLink('Extend');
$assert_session->pageTextContainsOnce('There is a security update available for your version of Drupal.'); $assert_session->pageTextContainsOnce('There is a security update available for your version of Drupal.');
$this->clickLink('Update'); $this->clickLink('Update');
$assert_session->pageTextContainsOnce('Drupal core updates are supported by the enabled Automatic Updates module');
$this->clickLink('Automatic Updates module');
$assert_session->pageTextNotContains('There is a security update available for your version of Drupal.'); $assert_session->pageTextNotContains('There is a security update available for your version of Drupal.');
$cells = $assert_session->elementExists('css', '#edit-projects .update-update-security') $cells = $assert_session->elementExists('css', '#edit-projects .update-update-security')
->findAll('css', 'td'); ->findAll('css', 'td');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment