Skip to content
Snippets Groups Projects
Commit 25a615eb authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3253055 by phenaproxima: Move 9.3 shim module into the main module

parent 01a9baf8
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,6 @@ type: module
description: 'Experimental module to develop automatic updates. Currently the module provides checks for update readiness but does not yet provide update functionality.'
core_version_requirement: ^9.2
dependencies:
- drupal:package_manager
- drupal:automatic_updates_9_3_shim
- drupal:package_manager
- drupal:update
......@@ -20,6 +20,37 @@ function automatic_updates_page_top() {
/** @var \Drupal\automatic_updates\Validation\AdminReadinessMessages $readiness_messages */
$readiness_messages = \Drupal::classResolver(AdminReadinessMessages::class);
$readiness_messages->displayAdminPageMessages();
// @todo Rely on the route option after https://www.drupal.org/i/3236497 is
// committed.
// @todo Remove 'system.batch_page.html' after
// https://www.drupal.org/i/3238311 is committed.
$skip_routes = [
'system.batch_page.html',
'automatic_updates.confirmation_page',
'automatic_updates.report_update',
'automatic_updates.module_update',
];
$route_name = \Drupal::routeMatch()->getRouteName();
if (!in_array($route_name, $skip_routes, TRUE) && function_exists('update_page_top')) {
update_page_top();
}
}
/**
* Implements hook_module_implements_alter().
*
* @todo Remove after https://www.drupal.org/i/3236497 is committed.
*/
function automatic_updates_module_implements_alter(&$implementations, $hook) {
if ($hook === 'page_top') {
// Remove hook_page_top() implementation from the Update module. This '
// implementation displays error messages about security releases. We call
// this implementation in our own automatic_updates_page_top() except on our
// own routes to avoid stale messages about the security releases after an
// update.
unset($implementations['update']);
}
}
/**
......
<?php
/**
* @file
* Contains hook implementations for Automatic Updates 9.3 shim module.
*/
/**
* Implements hook_page_top().
*/
function automatic_updates_9_3_shim_page_top() {
// @todo Rely on the route option after https://www.drupal.org/i/3236497 is
// committed.
// @todo Remove 'system.batch_page.html' after
// https://www.drupal.org/i/3238311 is committed.
$skip_routes = [
'system.batch_page.html',
'automatic_updates.confirmation_page',
'automatic_updates.report_update',
'automatic_updates.module_update',
];
$route_name = \Drupal::routeMatch()->getRouteName();
if (!in_array($route_name, $skip_routes, TRUE) && function_exists('update_page_top')) {
update_page_top();
}
}
/**
* Implements hook_module_implements_alter().
*
* @todo Remove after https://www.drupal.org/i/3236497 is committed.
*/
function automatic_updates_9_3_shim_module_implements_alter(&$implementations, $hook) {
if ($hook === 'page_top') {
// Remove hook_page_top() implementation from the Update module. This '
// implementation displays error messages about security releases. We call
// this implementation in our own automatic_updates_page_top() except on our
// own routes to avoid stale messages about the security releases after an
// update.
unset($implementations['update']);
}
}
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