Skip to content
Snippets Groups Projects
Commit 11e8a0fe authored by Lucas Hedding's avatar Lucas Hedding Committed by Lucas Hedding
Browse files

Issue #3093866 by rkoller, heddn: Add a clickable link to the readiness check...

Issue #3093866 by rkoller, heddn: Add a clickable link to the readiness check status message right after the first install
parent ca7d8d07
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Drupal\automatic_updates\ReadinessChecker\ReadinessCheckerManagerInterface; use Drupal\automatic_updates\ReadinessChecker\ReadinessCheckerManagerInterface;
use Drupal\update\UpdateManagerInterface; use Drupal\update\UpdateManagerInterface;
use Drupal\Core\Url;
/** /**
* Implements hook_page_top(). * Implements hook_page_top().
...@@ -27,6 +28,7 @@ function automatic_updates_page_top(array &$page_top) { ...@@ -27,6 +28,7 @@ function automatic_updates_page_top(array &$page_top) {
'update.settings', 'update.settings',
'system.status', 'system.status',
'update.confirmation_page', 'update.confirmation_page',
'automatic_updates.settings',
]; ];
// These routes don't need additional nagging. // These routes don't need additional nagging.
if (in_array(\Drupal::routeMatch()->getRouteName(), $disabled_routes, TRUE)) { if (in_array(\Drupal::routeMatch()->getRouteName(), $disabled_routes, TRUE)) {
...@@ -43,7 +45,10 @@ function automatic_updates_page_top(array &$page_top) { ...@@ -43,7 +45,10 @@ function automatic_updates_page_top(array &$page_top) {
} }
$last_check_timestamp = \Drupal::service('automatic_updates.readiness_checker')->timestamp(); $last_check_timestamp = \Drupal::service('automatic_updates.readiness_checker')->timestamp();
if (\Drupal::time()->getRequestTime() > $last_check_timestamp + ReadinessCheckerManagerInterface::LAST_CHECKED_WARNING) { if (\Drupal::time()->getRequestTime() > $last_check_timestamp + ReadinessCheckerManagerInterface::LAST_CHECKED_WARNING) {
\Drupal::messenger()->addError(t('Your site has not recently run an update readiness check.')); $readiness_settings = Url::fromRoute('automatic_updates.settings');
\Drupal::messenger()->addError(t('Your site has not recently run an update readiness check. <a href="@link">Administer automatic updates</a> and run readiness checks manually.', [
'@link' => $readiness_settings->toString(),
]));
} }
/** @var \Drupal\automatic_updates\ReadinessChecker\ReadinessCheckerManagerInterface $checker */ /** @var \Drupal\automatic_updates\ReadinessChecker\ReadinessCheckerManagerInterface $checker */
$checker = \Drupal::service('automatic_updates.readiness_checker'); $checker = \Drupal::service('automatic_updates.readiness_checker');
......
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