Commit 44a1d57f authored by Nikola Stojiljkovic's avatar Nikola Stojiljkovic Committed by Tymoteusz Motylewski
Browse files

[BUGFIX] Prevent validation from altering the field value

Resolves: #76124
Releases: master
Change-Id: Ib53e24c17c0f662db06f4db039c39c0e9eeb4b30
Reviewed-on: https://review.typo3.org/48067

Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
parent 7770faaf
......@@ -238,17 +238,20 @@ define(['jquery', 'TYPO3/CMS/Backend/FormEngine'], function ($, FormEngine) {
*/
FormEngineValidation.validateField = function($field, value) {
value = value || $field.val();
if (!$.isArray(value)) {
value = FormEngineValidation.ltrim(value);
}
var rules = $field.data('formengine-validation-rules');
var markParent = false;
var selected = 0;
// keep the original value, validateField should not alter it
var returnValue = value;
var $relatedField;
var minItems;
var maxItems;
if (!$.isArray(value)) {
value = FormEngineValidation.ltrim(value);
}
$.each(rules, function(k, rule) {
switch (rule.type) {
case 'required':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment