Project

General

Profile

Actions

Bug #76434

closed

Flexform range validation bug - regression

Added by Florian Rival over 8 years ago. Updated almost 4 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 #1

Updated by Claus Due over 8 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.

Actions #2

Updated by Georg Ringer over 8 years ago

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

Updated by Susanne Moog almost 7 years ago

  • Category set to FormEngine aka TCEforms
Actions #4

Updated by Oliver Hader almost 4 years ago

  • Status changed from New to Closed

Probably won't be handled as regression fix after four years

Actions

Also available in: Atom PDF