Skip to content

Commit

Permalink
Hide overwrites from disabled apps list on upgrade
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
MichaIng committed Feb 4, 2022
1 parent 50f51b1 commit 4744ce8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @author Lukas Reschke <[email protected]>
* @author MartB <[email protected]>
* @author Michael Gapczynski <[email protected]>
* @author MichaIng <[email protected]>
* @author Morris Jobke <[email protected]>
* @author Owen Winkler <[email protected]>
* @author Phil Davis <[email protected]>
Expand Down Expand Up @@ -381,11 +382,16 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig) {
$ocVersion = \OCP\Util::getVersion();
$ocVersion = implode('.', $ocVersion);
$incompatibleApps = $appManager->getIncompatibleApps($ocVersion);
$incompatibleOverwrites = $systemConfig->getValue('app_install_overwrite', []);
$incompatibleShippedApps = [];
$incompatibleDisabledApps = [];
foreach ($incompatibleApps as $appInfo) {
if ($appManager->isShipped($appInfo['id'])) {
$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
}
if (!in_array($appInfo['name'], $incompatibleOverwrites)) {
$incompatibleDisabledApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
}
}

if (!empty($incompatibleShippedApps)) {
Expand All @@ -395,7 +401,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig) {
}

$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
$tmpl->assign('incompatibleAppsList', $incompatibleApps);
$tmpl->assign('incompatibleAppsList', $incompatibleDisabledApps);
try {
$defaults = new \OC_Defaults();
$tmpl->assign('productName', $defaults->getName());
Expand Down

0 comments on commit 4744ce8

Please sign in to comment.