From 68f515ba0e80f05a512d3c559b76dbceca9058fe Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 3 Apr 2017 08:15:43 +1000 Subject: [PATCH] Exception handling when no core updates exist Fixes #2793 --- modules/system/controllers/Updates.php | 20 ++++++++++--------- .../controllers/updates/_update_list.htm | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index e8959381a..f2166dd28 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -336,19 +336,21 @@ class Updates extends Controller /* * Core */ - $coreImportant = false; + if (isset($result['core'])) { + $coreImportant = false; - foreach (array_get($result, 'core.updates', []) as $build => $description) { - if (strpos($description, '!!!') === false) continue; + 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; + $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'; } - $result['core']['isImportant'] = $coreImportant ? '1' : '0'; - /* * Plugins */ diff --git a/modules/system/controllers/updates/_update_list.htm b/modules/system/controllers/updates/_update_list.htm index 6e16f13e8..c534d5889 100644 --- a/modules/system/controllers/updates/_update_list.htm +++ b/modules/system/controllers/updates/_update_list.htm @@ -30,7 +30,7 @@
- $description): ?> + $description): ?>
$build])) ?>
@@ -104,7 +104,7 @@
- $description): ?> + $description): ?>