diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-02-28 22:39:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-28 22:39:35 +0100 |
commit | 48804619c99660a0c2485c658d4514a34c2501ea (patch) | |
tree | 0b2e998c1f609ef8f00c3eca3cf091cc9ea8d4e4 /core | |
parent | fb48abc35ab9d36c6d9eef5fa0ac1fe92bba0f73 (diff) | |
parent | 6c7ccbecbf6af5037a6c7bf2046bbf4d3bf91e2f (diff) | |
download | nextcloud-server-48804619c99660a0c2485c658d4514a34c2501ea.tar.gz nextcloud-server-48804619c99660a0c2485c658d4514a34c2501ea.zip |
Merge pull request #14398 from nextcloud/feature/14394/add-setup-check-for-mysql-utf8mb4
Add setup check for missing UTF8MB4 on mysql
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 12 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 87 |
2 files changed, 86 insertions, 13 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 7582b062d52..3e82e077994 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -438,6 +438,18 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } + if (data.isMysqlUsedWithoutUTF8MB4) { + messages.push({ + msg: t( + 'core', + 'MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read <a target="_blank" rel="noreferrer noopener" href="{docLink}">the documentation page about this</a>.', + { + docLink: oc_defaults.docPlaceholderUrl.replace('PLACEHOLDER', 'admin-mysql-utf8mb4'), + } + ), + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }) + } } else { messages.push({ diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index e2c0053aa71..aa9006d0ab5 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -247,7 +247,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -297,7 +298,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -348,7 +350,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -397,7 +400,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -444,7 +448,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -493,7 +498,8 @@ describe('OC.SetupChecks tests', function() { '/some/path' ], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -540,7 +546,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -587,7 +594,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -634,7 +642,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: false, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -702,7 +711,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -750,7 +760,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -798,7 +809,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -846,7 +858,8 @@ describe('OC.SetupChecks tests', function() { isMemoryLimitSufficient: true, appDirsWithDifferentOwner: [], recommendedPHPModules: [], - pendingBigIntConversionColumns: [] + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: false }) ); @@ -858,6 +871,54 @@ describe('OC.SetupChecks tests', function() { done(); }); }); + + it('should return an error if the php version is no longer supported', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({ + hasFileinfoInstalled: true, + isGetenvServerWorking: true, + isReadOnlyConfig: false, + hasWorkingFileLocking: true, + hasValidTransactionIsolationLevel: true, + suggestedOverwriteCliURL: '', + isRandomnessSecure: true, + securityDocs: 'https://docs.owncloud.org/myDocs.html', + serverHasInternetConnection: true, + isMemcacheConfigured: true, + forwardedForHeadersWorking: true, + isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, + isOpcacheProperlySetup: true, + hasOpcacheLoaded: true, + isSettimelimitAvailable: true, + hasFreeTypeSupport: true, + missingIndexes: [], + cronErrors: [], + cronInfo: { + diffInSeconds: 0 + }, + isMemoryLimitSufficient: true, + appDirsWithDifferentOwner: [], + recommendedPHPModules: [], + pendingBigIntConversionColumns: [], + isMysqlUsedWithoutUTF8MB4: true + }) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual([{ + msg: 'MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read <a href="https://docs.example.org/admin-mysql-utf8mb4" rel="noreferrer noopener">the documentation page about this</a>.', + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }]); + done(); + }); + }); }); describe('checkGeneric', function() { |