From 2dcae4e8ea4d065a9d84b57f44add3c27d54706e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Aug 2018 13:47:42 +0200 Subject: [PATCH 1/3] Keep the data of the local app (especially the version) Signed-off-by: Joas Schilling --- settings/Controller/AppSettingsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index 5930bc700d..f2ea784595 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -214,7 +214,7 @@ class AppSettingsController extends Controller { if (!array_key_exists($app['id'], $this->allApps)) { $this->allApps[$app['id']] = $app; } else { - $this->allApps[$app['id']] = array_merge($this->allApps[$app['id']], $app); + $this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]); } } From a9f8ee4e9d9aead633e77c151f41827c2a4ee30d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Aug 2018 14:26:31 +0200 Subject: [PATCH 2/3] Also allow to update apps which are currently not enabled Signed-off-by: Joas Schilling --- settings/Controller/AppSettingsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index f2ea784595..61db1ce269 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -256,7 +256,7 @@ class AppSettingsController extends Controller { $appData['category'] = $appstoreData['categories']; $newVersion = $this->installer->isUpdateAvailable($appData['id']); - if($newVersion && $this->appManager->isInstalled($appData['id'])) { + if($newVersion) { $appData['update'] = $newVersion; } From 483ad01a0933751732d84f40fab61c45050a7fa8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 2 Aug 2018 14:27:16 +0200 Subject: [PATCH 3/3] There is no update available if the app didnt have a version (aka was not installed) Signed-off-by: Joas Schilling --- lib/private/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index b6586eceab..d58ccb3694 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -389,7 +389,7 @@ class Installer { if($app['id'] === $appId) { $currentVersion = OC_App::getAppVersion($appId); $newestVersion = $app['releases'][0]['version']; - if (version_compare($newestVersion, $currentVersion, '>')) { + if ($currentVersion !== '0' && version_compare($newestVersion, $currentVersion, '>')) { return $newestVersion; } else { return false;