Skip to content

Commit c9a189c

Browse files
MichaIngbackportbot[bot]
authored andcommitted
Add Nextcloud docs link to OPcache recommends
A link to the Nextcloud documentation is currently only shown when the OPcache module is not loaded at all. This commit moves the link to the generic text above the individual recommendations list. Additionally remove the obsolete phpOpcacheDocumentation entry from test data arrays, which is not passed anymore by the backend. Signed-off-by: MichaIng <micha@dietpi.com>
1 parent db2fd71 commit c9a189c

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

apps/settings/lib/Controller/CheckSetupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ public function getFailedIntegrityCheckFiles(): DataDisplayResponse {
469469
protected function getOpcacheSetupRecommendations(): array {
470470
// If the module is not loaded, return directly to skip inapplicable checks
471471
if (!extension_loaded('Zend OPcache')) {
472-
return ['The PHP OPcache module is not loaded. <a target="_blank" rel="noreferrer noopener" class="external" href="' . $this->urlGenerator->linkToDocs('admin-php-opcache') . '">For better performance it is recommended</a> to load it into your PHP installation.'];
472+
return ['The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.'];
473473
}
474474

475475
$recommendations = [];

apps/settings/tests/Controller/CheckSetupControllerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,6 @@ public function testCheck() {
582582
if ($key === 'admin-code-integrity') {
583583
return 'http://docs.example.org/server/go.php?to=admin-code-integrity';
584584
}
585-
if ($key === 'admin-php-opcache') {
586-
return 'http://docs.example.org/server/go.php?to=admin-php-opcache';
587-
}
588585
if ($key === 'admin-db-conversion') {
589586
return 'http://docs.example.org/server/go.php?to=admin-db-conversion';
590587
}

core/js/setupchecks.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,9 @@
342342
listOfOPcacheRecommendations += "<li>" + element + "</li>";
343343
});
344344
messages.push({
345-
msg: t(
346-
'core',
347-
'The PHP OPcache module is not properly configured:'
348-
) + "<ul>" + listOfOPcacheRecommendations + "</ul>",
345+
msg: t('core', 'The PHP OPcache module is not properly configured. See the {linkstart}documentation ↗{linkend} for more information.')
346+
.replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + OC.theme.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-php-opcache') + '">')
347+
.replace('{linkend}', '</a>') + '<ul>' + listOfOPcacheRecommendations + '</ul>',
349348
type: OC.SetupChecks.MESSAGE_TYPE_INFO
350349
});
351350
}

core/js/tests/specs/setupchecksSpec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ describe('OC.SetupChecks tests', function() {
522522
isCorrectMemcachedPHPModuleInstalled: true,
523523
hasPassedCodeIntegrityCheck: true,
524524
OpcacheSetupRecommendations: [],
525-
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
526525
isSettimelimitAvailable: true,
527526
hasFreeTypeSupport: true,
528527
missingIndexes: [],
@@ -876,7 +875,6 @@ describe('OC.SetupChecks tests', function() {
876875
isCorrectMemcachedPHPModuleInstalled: true,
877876
hasPassedCodeIntegrityCheck: true,
878877
OpcacheSetupRecommendations: ['recommendation1', 'recommendation2'],
879-
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
880878
isSettimelimitAvailable: true,
881879
hasFreeTypeSupport: true,
882880
missingIndexes: [],
@@ -900,7 +898,7 @@ describe('OC.SetupChecks tests', function() {
900898

901899
async.done(function( data, s, x ){
902900
expect(data).toEqual([{
903-
msg: 'The PHP OPcache module is not properly configured:<ul><li>recommendation1</li><li>recommendation2</li></ul>',
901+
msg: 'The PHP OPcache module is not properly configured. See the <a target="_blank" rel="noreferrer noopener" class="external" href="https://docs.example.org/admin-php-opcache">documentation ↗</a> for more information.<ul><li>recommendation1</li><li>recommendation2</li></ul>',
904902
type: OC.SetupChecks.MESSAGE_TYPE_INFO
905903
}]);
906904
done();
@@ -932,7 +930,6 @@ describe('OC.SetupChecks tests', function() {
932930
isCorrectMemcachedPHPModuleInstalled: true,
933931
hasPassedCodeIntegrityCheck: true,
934932
OpcacheSetupRecommendations: [],
935-
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
936933
isSettimelimitAvailable: true,
937934
hasFreeTypeSupport: false,
938935
missingIndexes: [],

0 commit comments

Comments
 (0)