Show all in one message

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-11-16 12:27:22 +01:00
parent b228ed7bef
commit 6a525fadbb
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 9 additions and 4 deletions

View File

@ -377,7 +377,7 @@ class OC {
\OCP\Util::addScript('update'); \OCP\Util::addScript('update');
\OCP\Util::addStyle('update'); \OCP\Util::addStyle('update');
/** @var \OCP\App\IAppManager $appManager */ /** @var \OC\App\AppManager $appManager */
$appManager = \OC::$server->getAppManager(); $appManager = \OC::$server->getAppManager();
$tmpl = new OC_Template('', 'update.admin', 'guest'); $tmpl = new OC_Template('', 'update.admin', 'guest');
@ -387,14 +387,19 @@ class OC {
// get third party apps // get third party apps
$ocVersion = \OCP\Util::getVersion(); $ocVersion = \OCP\Util::getVersion();
$incompatibleApps = $appManager->getIncompatibleApps($ocVersion); $incompatibleApps = $appManager->getIncompatibleApps($ocVersion);
$incompatibleShippedApps = [];
foreach ($incompatibleApps as $appInfo) { foreach ($incompatibleApps as $appInfo) {
if ($appManager->isShipped($appInfo['id'])) { if ($appManager->isShipped($appInfo['id'])) {
$l = \OC::$server->getL10N('core'); $incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
$hint = $l->t('The files of the app %$1s (%$2s) were not replaced correctly. Make sure it is a version compatible with the server.', [$appInfo['name'], $appInfo['id']]);
throw new \OC\HintException('The files of the app ' . $appInfo['name'] . ' (' . $appInfo['id'] . ') were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
} }
} }
if (!empty($incompatibleShippedApps)) {
$l = \OC::$server->getL10N('core');
$hint = $l->t('The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
throw new \OC\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
}
$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion)); $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
$tmpl->assign('incompatibleAppsList', $incompatibleApps); $tmpl->assign('incompatibleAppsList', $incompatibleApps);
$tmpl->assign('productName', 'Nextcloud'); // for now $tmpl->assign('productName', 'Nextcloud'); // for now