-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display app names in update page for app updates #17434
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
<div class="update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>"> | ||
<div class="updateOverview"> | ||
<?php if ($_['isAppsOnlyUpgrade']) { ?> | ||
<h2 class="title bold"><?php p($l->t('Apps update required.')); ?></h2> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should say »App update required« (App without s, no dot at the end.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull request at #18453 |
||
<?php } else { ?> | ||
<h2 class="title bold"><?php p($l->t('%s will be updated to version %s.', | ||
array($_['productName'], $_['version']))); ?></h2> | ||
<?php if (!empty($_['appList'])) { ?> | ||
<?php } ?> | ||
<?php if (!empty($_['appsToUpgrade'])) { ?> | ||
<div class="infogroup"> | ||
<span class="bold"><?php p($l->t('These apps will be updated:')); ?></span> | ||
<ul class="content appList"> | ||
<?php foreach ($_['appsToUpgrade'] as $appInfo) { ?> | ||
<li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li> | ||
<?php } ?> | ||
</ul> | ||
</div> | ||
<?php } ?> | ||
<?php if (!empty($_['incompatibleAppsList'])) { ?> | ||
<div class="infogroup"> | ||
<span class="bold"><?php p($l->t('The following apps will be disabled:')) ?></span> | ||
<span class="bold"><?php p($l->t('These incompatible apps will be disabled:')) ?></span> | ||
<ul class="content appList"> | ||
<?php foreach ($_['appList'] as $appInfo) { ?> | ||
<?php foreach ($_['incompatibleAppsList'] as $appInfo) { ?> | ||
<li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li> | ||
<?php } ?> | ||
</ul> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -346,27 +346,7 @@ public static function checkUpgrade($showTemplate = true) { | |
if (\OCP\Util::needUpgrade()) { | ||
$systemConfig = \OC::$server->getSystemConfig(); | ||
if ($showTemplate && !$systemConfig->getValue('maintenance', false)) { | ||
$version = OC_Util::getVersion(); | ||
$oldTheme = $systemConfig->getValue('theme'); | ||
$systemConfig->setValue('theme', ''); | ||
OC_Util::addScript('config'); // needed for web root | ||
OC_Util::addScript('update'); | ||
$tmpl = new OC_Template('', 'update.admin', 'guest'); | ||
$tmpl->assign('version', OC_Util::getVersionString()); | ||
|
||
// get third party apps | ||
$apps = OC_App::getEnabledApps(); | ||
$incompatibleApps = array(); | ||
foreach ($apps as $appId) { | ||
$info = OC_App::getAppInfo($appId); | ||
if(!OC_App::isAppCompatible($version, $info)) { | ||
$incompatibleApps[] = $info; | ||
} | ||
} | ||
$tmpl->assign('appList', $incompatibleApps); | ||
$tmpl->assign('productName', 'ownCloud'); // for now | ||
$tmpl->assign('oldTheme', $oldTheme); | ||
$tmpl->printPage(); | ||
self::printUpgradePage(); | ||
exit(); | ||
} else { | ||
return true; | ||
|
@@ -375,6 +355,41 @@ public static function checkUpgrade($showTemplate = true) { | |
return false; | ||
} | ||
|
||
/** | ||
* Prints the upgrade page | ||
*/ | ||
private static function printUpgradePage() { | ||
$systemConfig = \OC::$server->getSystemConfig(); | ||
$oldTheme = $systemConfig->getValue('theme'); | ||
$systemConfig->setValue('theme', ''); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a thing?! 🙈 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly... this code was just moved here, I didn't write it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Please leave it. It caused a lot of trouble in the past. |
||
\OCP\Util::addScript('config'); // needed for web root | ||
\OCP\Util::addScript('update'); | ||
|
||
// check whether this is a core update or apps update | ||
$installedVersion = $systemConfig->getValue('version', '0.0.0'); | ||
$currentVersion = implode('.', OC_Util::getVersion()); | ||
|
||
$appManager = \OC::$server->getAppManager(); | ||
|
||
$tmpl = new OC_Template('', 'update.admin', 'guest'); | ||
$tmpl->assign('version', OC_Util::getVersionString()); | ||
|
||
// if not a core upgrade, then it's apps upgrade | ||
if (version_compare($currentVersion, $installedVersion, '=')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the part I added |
||
$tmpl->assign('isAppsOnlyUpgrade', true); | ||
} else { | ||
$tmpl->assign('isAppsOnlyUpgrade', false); | ||
} | ||
|
||
// get third party apps | ||
$ocVersion = OC_Util::getVersion(); | ||
$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion)); | ||
$tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion)); | ||
$tmpl->assign('productName', 'ownCloud'); // for now | ||
$tmpl->assign('oldTheme', $oldTheme); | ||
$tmpl->printPage(); | ||
} | ||
|
||
public static function initTemplateEngine() { | ||
// Add the stuff we need always | ||
// following logic will import all vendor libraries that are | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do app upgrades not occur at the same time as core upgrades? If they do, then we should surely display 'The following apps will be updated' alongside 'ownCloud will be updated'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell (without doing an actual upgrade), we will see:
IMHO we still need to display 'The following apps will be updated' under 'ownCloud will be updated'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also thought about this.
I'll try and add them to both pages.