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 <micha@dietpi.com>
  • Loading branch information
MichaIng committed Jan 3, 2022
1 parent 5ae544b commit 9dc53c3
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 <lukas@statuscode.ch>
* @author MartB <mart.b@outlook.de>
* @author Michael Gapczynski <GapczynskiM@gmail.com>
* @author MichaIng <micha@dietpi.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Owen Winkler <a_github@midnightcircus.com>
* @author Phil Davis <phil.davis@inf.org>
Expand Down Expand Up @@ -378,11 +379,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 @@ -392,7 +398,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 9dc53c3

Please sign in to comment.