From 5ac91f1cb8fc8a2ddca1336c976a39385dd8c4cd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 18 Feb 2022 16:36:43 +0100 Subject: [PATCH] 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 --- apps/settings/lib/Controller/CheckSetupController.php | 2 +- .../settings/tests/Controller/CheckSetupControllerTest.php | 3 --- core/js/setupchecks.js | 7 +++---- core/js/tests/specs/setupchecksSpec.js | 5 +---- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 11900fad45b..55207b3e74b 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -469,7 +469,7 @@ Raw output protected function getOpcacheSetupRecommendations(): array { // If the module is not loaded, return directly to skip inapplicable checks if (!extension_loaded('Zend OPcache')) { - return ['The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.']; + return ['The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.']; } $recommendations = []; diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index 20cf2b01069..4349994570b 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -582,9 +582,6 @@ class CheckSetupControllerTest extends TestCase { if ($key === 'admin-code-integrity') { return 'http://docs.example.org/server/go.php?to=admin-code-integrity'; } - if ($key === 'admin-php-opcache') { - return 'http://docs.example.org/server/go.php?to=admin-php-opcache'; - } if ($key === 'admin-db-conversion') { return 'http://docs.example.org/server/go.php?to=admin-db-conversion'; } diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index fdeed4897d0..95d8c6cbdc2 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -342,10 +342,9 @@ listOfOPcacheRecommendations += "
  • " + element + "
  • "; }); messages.push({ - msg: t( - 'core', - 'The PHP OPcache module is not properly configured:' - ) + "", + msg: t('core', 'The PHP OPcache module is not properly configured. See the {linkstart}documentation ↗{linkend} for more information.') + .replace('{linkstart}', '') + .replace('{linkend}', '') + '', type: OC.SetupChecks.MESSAGE_TYPE_INFO }); } diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index cfadcef6746..5975c875c3b 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -522,7 +522,6 @@ describe('OC.SetupChecks tests', function() { isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], - phpOpcacheDocumentation: 'https://example.org/link/to/doc', isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], @@ -876,7 +875,6 @@ describe('OC.SetupChecks tests', function() { isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: ['recommendation1', 'recommendation2'], - phpOpcacheDocumentation: 'https://example.org/link/to/doc', isSettimelimitAvailable: true, hasFreeTypeSupport: true, missingIndexes: [], @@ -900,7 +898,7 @@ describe('OC.SetupChecks tests', function() { async.done(function( data, s, x ){ expect(data).toEqual([{ - msg: 'The PHP OPcache module is not properly configured:', + msg: 'The PHP OPcache module is not properly configured. See the documentation ↗ for more information.', type: OC.SetupChecks.MESSAGE_TYPE_INFO }]); done(); @@ -932,7 +930,6 @@ describe('OC.SetupChecks tests', function() { isCorrectMemcachedPHPModuleInstalled: true, hasPassedCodeIntegrityCheck: true, OpcacheSetupRecommendations: [], - phpOpcacheDocumentation: 'https://example.org/link/to/doc', isSettimelimitAvailable: true, hasFreeTypeSupport: false, missingIndexes: [], -- 2.39.5