Project

General

Profile

Actions

Bug #90640

closed

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

Added by Christian Eßl over 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 #1

Updated by Björn Jacob about 4 years ago

  • Sprint Focus set to Remote Sprint
Actions #2

Updated by Björn Jacob almost 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.

Actions #3

Updated by Björn Jacob almost 3 years ago

  • Related to Task #94876: Remove validator "Non-XML text" in UI added
Actions #4

Updated by Björn Jacob almost 3 years ago

Created #94876 for renaming another validator. Within this issue we are concentrating on the regex stuff.

Actions #5

Updated by Mathias Brodala almost 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.

Actions #6

Updated by Mathias Brodala almost 3 years ago

  • Status changed from New to In Progress
  • Assignee set to Mathias Brodala
  • Target version set to 11 LTS
Actions #7

Updated by Björn Jacob almost 3 years ago

  • Assignee changed from Mathias Brodala to Björn Jacob
Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Gerrit Code Review almost 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

Actions #14

Updated by Benni Mack over 2 years ago

  • Target version changed from 11 LTS to Candidate for patchlevel
Actions #15

Updated by Gerrit Code Review over 2 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

Actions #16

Updated by Gerrit Code Review over 2 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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

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

Actions #21

Updated by Björn Jacob over 2 years ago

  • Related to Bug #91340: RegEx validator in EXT:form does not support negative lookbehind added
Actions #22

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

Actions #23

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

Actions #24

Updated by Gerrit Code Review about 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

Actions #25

Updated by Gerrit Code Review about 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

Actions #26

Updated by Gerrit Code Review about 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

Actions #27

Updated by Anonymous about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #28

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF