]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add Nextcloud docs link to OPcache recommends 31267/head
authorMichaIng <micha@dietpi.com>
Fri, 18 Feb 2022 15:36:43 +0000 (16:36 +0100)
committerSimon L. (Rebase PR Action) <szaimen@e.mail.de>
Thu, 3 Mar 2022 23:00:07 +0000 (23:00 +0000)
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>
apps/settings/lib/Controller/CheckSetupController.php
apps/settings/tests/Controller/CheckSetupControllerTest.php
core/js/setupchecks.js
core/js/tests/specs/setupchecksSpec.js

index 11900fad45b9e2b8b50ca840427099376944966c..55207b3e74be1ed75c9eeffb1927c3f34547dd40 100644 (file)
@@ -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. <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.'];
+                       return ['The PHP OPcache module is not loaded. For better performance it is recommended to load it into your PHP installation.'];
                }
 
                $recommendations = [];
index 20cf2b0106984ee996d2578dc759ed6ecde72224..4349994570bb1367929d24f46d18ec6f052e7f00 100644 (file)
@@ -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';
                                }
index fdeed4897d091585e8393d391afc8aabf9a5802b..95d8c6cbdc299d62728086ef92d3393811a1990a 100644 (file)
                                                        listOfOPcacheRecommendations += "<li>" + element + "</li>";
                                                });
                                                messages.push({
-                                                       msg: t(
-                                                               'core',
-                                                               'The PHP OPcache module is not properly configured:'
-                                                       ) + "<ul>" + listOfOPcacheRecommendations + "</ul>",
+                                                       msg: t('core', 'The PHP OPcache module is not properly configured. See the {linkstart}documentation ↗{linkend} for more information.')
+                                                               .replace('{linkstart}', '<a target="_blank" rel="noreferrer noopener" class="external" href="' + OC.theme.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-php-opcache') + '">')
+                                                               .replace('{linkend}', '</a>') + '<ul>' + listOfOPcacheRecommendations + '</ul>',
                                                        type: OC.SetupChecks.MESSAGE_TYPE_INFO
                                                });
                                        }
index cfadcef674651c7d142b562831ba1f3e2860b1d5..5975c875c3bce2905957c4c4362884f26d6e8504 100644 (file)
@@ -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:<ul><li>recommendation1</li><li>recommendation2</li></ul>',
+                                               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>',
                                                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: [],