Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/OC.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

use OC\App\InfoParser;
use OC\Files\Filesystem;
use OC\NavigationManager;
use OC\Profiler\BuiltInProfiler;
Expand Down Expand Up @@ -351,6 +352,9 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {

/** @var \OC\App\AppManager $appManager */
$appManager = Server::get(\OCP\App\IAppManager::class);
$l10nFactory = Server::get(\OCP\L10N\IFactory::class);
$infoParser = new InfoParser();
$lang = $l10nFactory->findLanguage();

// get third party apps
$ocVersion = $serverVersion->getVersion();
Expand All @@ -360,6 +364,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
$incompatibleShippedApps = [];
$incompatibleDisabledApps = [];
foreach ($incompatibleApps as $appInfo) {
$appInfo = $infoParser->applyL10N($appInfo, $lang);
if ($appManager->isShipped($appInfo['id'])) {
$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
}
Expand All @@ -369,13 +374,14 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
}

if (!empty($incompatibleShippedApps)) {
$l = Server::get(\OCP\L10N\IFactory::class)->get('core');
$l = $l10nFactory->get('core');
$hint = $l->t('Application %1$s is not present or has a non-compatible version with this server. Please check the apps directory.', [implode(', ', $incompatibleShippedApps)]);
throw new \OCP\HintException('Application ' . implode(', ', $incompatibleShippedApps) . ' is not present or has a non-compatible version with this server. Please check the apps directory.', $hint);
}

$appConfig = Server::get(IAppConfig::class);
$appsToUpgrade = array_map(function ($app) use (&$appConfig) {
$appsToUpgrade = array_map(function ($app) use (&$appConfig, $infoParser, $lang) {
$app = $infoParser->applyL10N($app, $lang);
return [
'id' => $app['id'],
'name' => $app['name'],
Expand Down
Loading