Skip to content
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

[stable26] allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation #38752

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2137,6 +2137,11 @@
*/
'upgrade.disable-web' => false,

/**
* Allows to modify the cli-upgrade link in order to link to a different documentation
*/
'upgrade.cli-upgrade-link' => '',

/**
* Set this Nextcloud instance to debugging mode
*
Expand Down
10 changes: 7 additions & 3 deletions core/templates/update.use-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
<?php if ($_['tooBig']) {
p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
} else {
p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
p($l->t('Please use the command line updater because updating via browser is disabled in your config.php.'));
} ?><br><br>
<?php
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?>
<?php if (is_string($_['cliUpgradeLink']) && $_['cliUpgradeLink'] !== '') {
$cliUpgradeLink = $_['cliUpgradeLink'];
} else {
$cliUpgradeLink = link_to_docs('admin-cli-upgrade');
}
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [$cliUpgradeLink])); ?>
</div>
</div>

Expand Down
2 changes: 2 additions & 0 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): voi
* Prints the upgrade page
*/
private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
$cliUpgradeLink = $systemConfig->getValue('upgrade.cli-upgrade-link', '');
$disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false);
$tooBig = false;
if (!$disableWebUpdater) {
Expand Down Expand Up @@ -355,6 +356,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
$template->assign('productName', 'nextcloud'); // for now
$template->assign('version', OC_Util::getVersionString());
$template->assign('tooBig', $tooBig);
$template->assign('cliUpgradeLink', $cliUpgradeLink);

$template->printPage();
die();
Expand Down