[BUGFIX] Fix password evaluation for TCA input field 57/48457/2
authormtoscanelli <m.toscanelli@code-source.ch>
Sun, 5 Jun 2016 09:34:58 +0000 (11:34 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Tue, 7 Jun 2016 15:16:08 +0000 (17:16 +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/48457
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js

index 66b012c..0321f18 100644 (file)
@@ -204,7 +204,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;
 
@@ -217,13 +216,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);
                }
        };
 
@@ -487,8 +481,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') {