Actions
Bug #90640
closedext:form - RegularExpressionValidator with empty value will lead to exception
Status:
Closed
Priority:
Should have
Assignee:
Category:
Form Framework
Target version:
Start date:
2020-03-04
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint
Description
In the form management, you can add a "RegularExpressionValidator" to a form field that has an invalid regex (like "0") and successfully save the form.
The error in the regex can then only be detected when submitting the form in the frontend (and filling out the validated field, if it's empty, the Validator will never be called) by throwing an exception:
Core: Exception handler (FE): Uncaught TYPO3 Exception: #1298273089: regularExpression "0" in RegularExpressionValidator contained an error. | TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationOptionsException thrown in file /.../web/typo3/sysext/extbase/Classes/Validation/Validator/RegularExpressionValidator.php in line 48
This isn't that great, as a normal editor can create a form and it's easy to miss that error. (The user just needs to add a RegularExpressionValidator and do nothing with it)
So I think upon saving the form, there should be a validation that checks if the value of the RegularExpressionValidator is actually valid.
Actions