Use app ID instead of object

Fixes several error messages when installing an app from the appstore, including:

```
Illegal offset type in isset or empty at /media/psf/stable9/lib/private/legacy/app.php#662
Illegal offset type at /media/psf/stable9/lib/private/legacy/app.php#663
Illegal offset type at /media/psf/stable9/lib/private/legacy/app.php#661
Object of class OC_App could not be converted to string at /media/psf/stable9/lib/private/legacy/app.php#81
trim() expects parameter 1 to be string, object given at /media/psf/stable9/lib/private/legacy/app.php#628
```

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-11-22 00:24:23 +01:00
parent 2786877013
commit 8ee11956da
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ try {
$appId = (string)$_POST['appid'];
$appId = OC_App::cleanAppId($appId);
$app->enable($appId, $groups);
OC_JSON::success(['data' => ['update_required' => \OC_App::shouldUpgrade($app)]]);
OC_JSON::success(['data' => ['update_required' => \OC_App::shouldUpgrade($appId)]]);
} catch (Exception $e) {
\OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR);
OC_JSON::error(array("data" => array("message" => $e->getMessage()) ));