Bug #90640
closedext:form - RegularExpressionValidator with empty value will lead to exception
100%
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.
Updated by Björn Jacob over 3 years ago
- TYPO3 Version changed from 9 to 11
Is it a good idea to allow editors to add something difficult as a "RegularExpressionValidator"? We have to discuss this and some of the other options.
Updated by Björn Jacob over 3 years ago
- Related to Task #94876: Remove validator "Non-XML text" in UI added
Updated by Björn Jacob over 3 years ago
Created #94876 for renaming another validator. Within this issue we are concentrating on the regex stuff.
Updated by Mathias Brodala over 3 years ago
Issue #94876 will now be used to remove the "Non-XML text" validator from the UI since it is not useful for editors. The same can be said about the RegEx validator which should also be removed from the form editor.
The error mentioned here cannot occur anymore then. If one specifies an invalid pattern when manually adding the RegEx validator to a form definition YAML, he should know about this and how to fix it.
Updated by Mathias Brodala over 3 years ago
- Status changed from New to In Progress
- Assignee set to Mathias Brodala
- Target version set to 11 LTS
Updated by Björn Jacob about 3 years ago
- Assignee changed from Mathias Brodala to Björn Jacob
Updated by Gerrit Code Review about 3 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review about 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review about 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review about 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review about 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review about 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Benni Mack about 3 years ago
- Target version changed from 11 LTS to Candidate for patchlevel
Updated by Gerrit Code Review almost 3 years ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review almost 3 years ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review over 2 years ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review over 2 years ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review over 2 years ago
Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Gerrit Code Review over 2 years ago
Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70889
Updated by Björn Jacob over 2 years ago
- Related to Bug #91340: RegEx validator in EXT:form does not support negative lookbehind added
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73689
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73692
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73692
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73692
Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73692
Updated by Anonymous over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6d1df41bad403f4e7c5cfdc898c7ecb8a12bbaed.