[BUGFIX] Fix password evaluation for TCA input field 52/48452/3
authormtoscanelli <m.toscanelli@code-source.ch>
Sun, 5 Jun 2016 09:34:58 +0000 (11:34 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 6 Jun 2016 10:56:59 +0000 (12:56 +0200)
Password evaluation is only used for display purpose.

Skip password evaluation value processing.
Set the correct value in main and human readable fields.

Resolves: #76456
Releases: master, 7.6
Change-Id: I58d1e2b9922ee21b7ccacb83e7989c9c9c2df02f
Reviewed-on: https://review.typo3.org/48452
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js

index 8ba8c8a..aed472e 100644 (file)
@@ -208,7 +208,6 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                var config = $mainField.data('config');
                if (typeof config !== 'undefined') {
                        var evalList = FormEngineValidation.trimExplode(',', config.evalList);
-                       var origValue = $humanReadableField.val();
                        var newValue = $humanReadableField.val();
                        var i;
 
@@ -221,13 +220,8 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                                formattedValue = FormEngineValidation.formatValue(evalList[i], formattedValue, config);
                        }
 
-                       if ($.inArray('password', evalList) !== -1) {
-                               $mainField.val(origValue);
-                               $humanReadableField.val(newValue);
-                       } else {
-                               $mainField.val(newValue);
-                               $humanReadableField.val(formattedValue);
-                       }
+                       $mainField.val(newValue);
+                       $humanReadableField.val(formattedValue);
                }
        };
 
@@ -485,8 +479,7 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
                                // unknown type null, we ignore it
                                break;
                        case 'password':
-                               var theString = (value) ? FormEngineValidation.passwordDummy : '';
-                               returnValue = theString;
+                               // password is only a display evaluation, we ignore it
                                break;
                        default:
                                if (typeof TBE_EDITOR.customEvalFunctions !== 'undefined' && typeof TBE_EDITOR.customEvalFunctions[command] === 'function') {