From bbd1da4dd4c4d5a9140ba0f556d0c23f56ed2bbf Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Mon, 18 Sep 2017 18:31:28 +0300 Subject: [PATCH] close #5 fixed: Update center core version issue --- app/Http/Controllers/Install/Updates.php | 35 +++++++++++-------- .../views/install/updates/index.blade.php | 2 +- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Install/Updates.php b/app/Http/Controllers/Install/Updates.php index 5ef9a4bfb..340ecedc8 100644 --- a/app/Http/Controllers/Install/Updates.php +++ b/app/Http/Controllers/Install/Updates.php @@ -19,26 +19,33 @@ class Updates extends Controller { $updates = Updater::all(); - $core = $updates['core']; + $core = null; $modules = array(); + if (isset($updates['core'])) { + $core = $updates['core']; + } + $rows = Module::all(); - foreach ($rows as $row) { - $alias = $row->get('alias'); - if (!isset($updates[$alias])) { - continue; + if ($rows) { + foreach ($rows as $row) { + $alias = $row->get('alias'); + + if (!isset($updates[$alias])) { + continue; + } + + $m = new \stdClass(); + $m->name = $row->get('name'); + $m->alias = $row->get('alias'); + $m->category = $row->get('category'); + $m->installed = $row->get('version'); + $m->latest = $updates[$alias]; + + $modules[] = $m; } - - $m = new \stdClass(); - $m->name = $row->get('name'); - $m->alias = $row->get('alias'); - $m->category = $row->get('category'); - $m->installed = $row->get('version'); - $m->latest = $updates[$alias]; - - $modules[] = $m; } return view('install.updates.index', compact('core', 'modules')); diff --git a/resources/views/install/updates/index.blade.php b/resources/views/install/updates/index.blade.php index 593e5172a..8c17e1a48 100644 --- a/resources/views/install/updates/index.blade.php +++ b/resources/views/install/updates/index.blade.php @@ -16,7 +16,7 @@ {{ trans('updates.latest_core') }} @else {{ trans('updates.new_core') }} -  {{ trans('updates.update', ['version' => $core]) }} +  {{ trans('updates.update', ['version' => $core]) }}  {{ trans('updates.changelog') }} @endif