From d472a0b0a8da189796ef02a5c8298d0ba7e29448 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 1 Apr 2017 12:07:24 +1100 Subject: [PATCH] Core updates now support !!! (important) There have been some small internal API changes that have been causing grief for some users. While all updates are technically "safe", user workarounds and custom implementations can never be predicted with certainty. This change will allow us to say with confidence, either - Yep, no worries this is a safe update. Relax. Versus; - Might want to watch this one, just in case. --- modules/system/controllers/Updates.php | 21 ++++++++++++++ .../controllers/updates/_update_list.htm | 28 +++++++++++++++++-- modules/system/lang/en/lang.php | 5 ++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index d520eb212..e8959381a 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -332,6 +332,26 @@ class Updates extends Controller protected function processImportantUpdates($result) { $hasImportantUpdates = false; + + /* + * Core + */ + $coreImportant = false; + + foreach (array_get($result, 'core.updates', []) as $build => $description) { + if (strpos($description, '!!!') === false) continue; + + $detailsUrl = '//octobercms.com/support/articles/release-notes'; + $description = str_replace('!!!', '', $description); + $result['core']['updates'][$build] = [$description, $detailsUrl]; + $coreImportant = $hasImportantUpdates = true; + } + + $result['core']['isImportant'] = $coreImportant ? '1' : '0'; + + /* + * Plugins + */ foreach (array_get($result, 'plugins', []) as $code => $plugin) { $isImportant = false; @@ -348,6 +368,7 @@ class Updates extends Controller } $result['hasImportantUpdates'] = $hasImportantUpdates; + return $result; } diff --git a/modules/system/controllers/updates/_update_list.htm b/modules/system/controllers/updates/_update_list.htm index f1ee3158e..6e16f13e8 100644 --- a/modules/system/controllers/updates/_update_list.htm +++ b/modules/system/controllers/updates/_update_list.htm @@ -11,8 +11,19 @@
-
+
+ +
+ +
+
@@ -21,7 +32,20 @@
$description): ?>
$build])) ?>
-
+ +
+ + + + + + + + +
+ +
+
$core['old_build']])) ?>
diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 7f3364aaa..b227f541e 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -269,11 +269,12 @@ return [ 'important_action' => [ 'empty' => 'Select action', 'confirm' => 'Confirm update', - 'skip' => 'Skip this plugin (once only)', - 'ignore' => 'Skip this plugin (always)' + 'skip' => 'Skip this update (once only)', + 'ignore' => 'Skip this update (always)' ], 'important_action_required' => 'Action required', 'important_view_guide' => 'View upgrade guide', + 'important_view_release_notes' => 'View release notes', 'important_alert_text' => 'Some updates need your attention.', 'details_title' => 'Plugin details', 'details_view_homepage' => 'View homepage',