Project

General

Profile

Actions

Bug #90640

closed

ext:form - RegularExpressionValidator with empty value will lead to exception

Added by Christian Eßl about 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Form Framework
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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #94876: Remove validator "Non-XML text" in UIClosedMathias Brodala2021-08-13

Actions
Related to TYPO3 Core - Bug #91340: RegEx validator in EXT:form does not support negative lookbehindClosed2020-05-07

Actions
Actions

Also available in: Atom PDF