Project

General

Profile

Actions

Bug #76434

closed

Flexform range validation bug - regression

Added by Florian Rival almost 8 years ago. Updated over 3 years ago.

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

0%

Estimated time:
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

Actions

Also available in: Atom PDF