From f7b518fdbf70770e29a00a3b0430de97b927ee6a Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Thu, 3 May 2018 08:22:03 +0200
Subject: [PATCH] Get correct version of an app

Related to #8929

We should get the version of the app. Not of the appfolder. Else there
is no way to properly compare the versions.

Now note that installing in 1 go will still fail. But at least on the
next page load the new version will be properly detected.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 lib/private/legacy/app.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 7931eecc502..70f1b16e3c6 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -464,7 +464,7 @@ class OC_App {
 		} else {
 			$versionToLoad = [];
 			foreach ($possibleApps as $possibleApp) {
-				$version = self::getAppVersionByPath($possibleApp['path']);
+				$version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId);
 				if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) {
 					$versionToLoad = array(
 						'dir' => $possibleApp,
-- 
GitLab