Bug #76434

Flexform range validation bug - regression

Added by Florian Rival about 3 years ago. Updated over 1 year ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2016-06-02
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Hello,

I found a bug in the script : typo3_src/typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js
This bug appears in Typo3 7.6.9, there's no bug with version 7.6.4.

To reproduce this bug, create a content template with this code :

<flux:field.input name="settings.number" label="Number" required="TRUE"/>

Then in the imput form in the BE, if you enter a numeric value (it's ok with an alphabetic value) and try to save the form, you have the message :

The fields marked with an exclamation mark are not yet correctly filled in. Please complete them properly.

This bug apperas because of the validation rule "typeof rule.config.upper", I think it's becasue the value is 'null' instead of 'undefined'.

FormEngineValidation.validateField = function($field, value) {
    ...
    case 'range':
            ....
            if (typeof rule.config.upper !== 'undefined') {
                var maxValue = rule.config.upper * 1;
                if (!isNaN(maxValue) && value > maxValue) {
                    markParent = true;
                    $field.closest(FormEngineValidation.markerSelector).addClass(FormEngineValidation.errorClass);
                }
            }
    ...
}

Thanks,
Florian

History

#1 Updated by Claus Due about 3 years ago

As far as I know this one is "as designed" now. The usage is corrected in Flux and I don't think a core change is needed? If anything: such a change should check if those values are "null" and if they are, not pass them to the JS config.

#2 Updated by Georg Ringer about 3 years ago

  • Subject changed from Felxform range validation bug - regression to Flexform range validation bug - regression

#3 Updated by Susanne Moog over 1 year ago

  • Category set to FormEngine aka TCEforms

Also available in: Atom PDF