diff --git a/automatic_updates.links.task.yml b/automatic_updates.links.task.yml deleted file mode 100644 index 239f899432ca6bc4d901610f7ce0e6e40642a651..0000000000000000000000000000000000000000 --- a/automatic_updates.links.task.yml +++ /dev/null @@ -1,10 +0,0 @@ -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 diff --git a/automatic_updates.module b/automatic_updates.module index 1379ccbb91731d6b9b3e661a6758fb85c401a8e1..48b88b1898383f4e46d7d34199827d1d91c9adb4 100644 --- a/automatic_updates.module +++ b/automatic_updates.module @@ -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; + } + } +} diff --git a/automatic_updates.routing.yml b/automatic_updates.routing.yml index 4c12d0f5f7deebc9f77fdd9ad566acd0faa4c040..a886f78046d243516b4d63a24ed4bf0bb824aaad 100644 --- a/automatic_updates.routing.yml +++ b/automatic_updates.routing.yml @@ -33,3 +33,12 @@ automatic_updates.module_update: _permission: 'administer software updates' options: _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 diff --git a/tests/src/Build/CoreUpdateTest.php b/tests/src/Build/CoreUpdateTest.php index d391cda0be154e4645c79e616a63bcb24c6f4260..cf0d7256eae74fa349cf263422b26939b9e722b3 100644 --- a/tests/src/Build/CoreUpdateTest.php +++ b/tests/src/Build/CoreUpdateTest.php @@ -120,7 +120,7 @@ class CoreUpdateTest extends UpdateTestBase { $assert_session = $mink->assertSession(); $this->visit('/admin/modules'); $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.'); $page->pressButton('Update'); $this->waitForBatchJob(); diff --git a/tests/src/Functional/UpdaterFormTest.php b/tests/src/Functional/UpdaterFormTest.php index df68ffc7b13f15644fe464f918c20c75289a3834..d03229896d367e8167e963a042b64843fa966206 100644 --- a/tests/src/Functional/UpdaterFormTest.php +++ b/tests/src/Functional/UpdaterFormTest.php @@ -99,8 +99,6 @@ class UpdaterFormTest extends BrowserTestBase { $this->clickLink('Extend'); $assert_session->pageTextContainsOnce('There is a security update available for your version of Drupal.'); $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.'); $cells = $assert_session->elementExists('css', '#edit-projects .update-update-security') ->findAll('css', 'td');