[BUGFIX] Avoid JS error when using 'eval' => 'int,nospace' in TCA 03/55503/2
authorStephan Großberndt <stephan@grossberndt.de>
Tue, 30 Jan 2018 11:12:43 +0000 (12:12 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Tue, 30 Jan 2018 15:10:05 +0000 (16:10 +0100)
By casting the JavaScript variable to string this patch avoids an error
if 'eval' => 'int,nospace' is used in a TCA column definition.

Resolves: #83731
Releases: master, 8.7
Change-Id: I5be79bf6cd748ac184505f0aa4bd97c7d934eebd
Reviewed-on: https://review.typo3.org/55503
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js

index 628fe04..288fcbd 100644 (file)
@@ -425,7 +425,7 @@ define(['jquery', 'moment'], function ($, moment) {
                                returnValue = newString;
                                break;
                        case 'nospace':
-                               returnValue = '' + value.replace(/ /g, '');
+                               returnValue = ('' + value).replace(/ /g, '');
                                break;
                        case 'md5':
                                if (value !== '') {