Skip to content

Commit 9a86907

Browse files
committed
Hide overwrites from disabled apps list on upgrade
If an incompatible app is enabled manually, it is added to the "app_install_overwrite" array in config.php. Nextcloud upgrades won't disable any app in this array, but they were still shown on the upgrade page as being disabled. This commit assures that only apps are shown as "These incompatible apps will be disabled:" which are really disabled, i.e. which are not in the "app_install_overwrite" array. Signed-off-by: MichaIng <micha@dietpi.com>
1 parent e56d1dd commit 9a86907

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/base.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @author Lukas Reschke <lukas@statuscode.ch>
3232
* @author MartB <mart.b@outlook.de>
3333
* @author Michael Gapczynski <GapczynskiM@gmail.com>
34+
* @author MichaIng <micha@dietpi.com>
3435
* @author Morris Jobke <hey@morrisjobke.de>
3536
* @author Owen Winkler <a_github@midnightcircus.com>
3637
* @author Phil Davis <phil.davis@inf.org>
@@ -378,11 +379,16 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig) {
378379
$ocVersion = \OCP\Util::getVersion();
379380
$ocVersion = implode('.', $ocVersion);
380381
$incompatibleApps = $appManager->getIncompatibleApps($ocVersion);
382+
$incompatibleOverwrites = $systemConfig->getValue('app_install_overwrite', []);
381383
$incompatibleShippedApps = [];
384+
$incompatibleDisabledApps = [];
382385
foreach ($incompatibleApps as $appInfo) {
383386
if ($appManager->isShipped($appInfo['id'])) {
384387
$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
385388
}
389+
if (!in_array($appInfo['name'], $incompatibleOverwrites)) {
390+
$incompatibleDisabledApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
391+
}
386392
}
387393

388394
if (!empty($incompatibleShippedApps)) {
@@ -392,7 +398,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig) {
392398
}
393399

394400
$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
395-
$tmpl->assign('incompatibleAppsList', $incompatibleApps);
401+
$tmpl->assign('incompatibleAppsList', $incompatibleDisabledApps);
396402
try {
397403
$defaults = new \OC_Defaults();
398404
$tmpl->assign('productName', $defaults->getName());

0 commit comments

Comments
 (0)