Skip to content

Commit 34c9856

Browse files
authored
Merge pull request #38751 from nextcloud/backport/38735/stable27
[stable27] allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation
2 parents 404eb86 + c5b43a4 commit 34c9856

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

config/config.sample.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,11 @@
21492149
*/
21502150
'upgrade.disable-web' => false,
21512151

2152+
/**
2153+
* Allows to modify the cli-upgrade link in order to link to a different documentation
2154+
*/
2155+
'upgrade.cli-upgrade-link' => '',
2156+
21522157
/**
21532158
* Set this Nextcloud instance to debugging mode
21542159
*

core/ajax/update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function handleRepairFeedback(Event $event): void {
100100
if (\OCP\Util::needUpgrade()) {
101101
$config = \OC::$server->getSystemConfig();
102102
if ($config->getValue('upgrade.disable-web', false)) {
103-
$eventSource->send('failure', $l->t('Please use the command line updater because updating via the browser is disabled in your config.php.'));
103+
$eventSource->send('failure', $l->t('Please use the command line updater because updating via browser is disabled in your config.php.'));
104104
$eventSource->close();
105105
exit();
106106
}

core/templates/update.use-cli.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
<?php if ($_['tooBig']) {
66
p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
77
} else {
8-
p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
8+
p($l->t('Please use the command line updater because updating via browser is disabled in your config.php.'));
99
} ?><br><br>
10-
<?php
11-
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?>
10+
<?php if (is_string($_['cliUpgradeLink']) && $_['cliUpgradeLink'] !== '') {
11+
$cliUpgradeLink = $_['cliUpgradeLink'];
12+
} else {
13+
$cliUpgradeLink = link_to_docs('admin-cli-upgrade');
14+
}
15+
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [$cliUpgradeLink])); ?>
1216
</div>
1317
</div>
1418

lib/base.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): voi
312312
* Prints the upgrade page
313313
*/
314314
private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
315+
$cliUpgradeLink = $systemConfig->getValue('upgrade.cli-upgrade-link', '');
315316
$disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false);
316317
$tooBig = false;
317318
if (!$disableWebUpdater) {
@@ -358,6 +359,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
358359
$template->assign('productName', 'nextcloud'); // for now
359360
$template->assign('version', OC_Util::getVersionString());
360361
$template->assign('tooBig', $tooBig);
362+
$template->assign('cliUpgradeLink', $cliUpgradeLink);
361363

362364
$template->printPage();
363365
die();

0 commit comments

Comments
 (0)