#76434Flexform range validation bug - regression
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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.