-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] component config form not saving when validation fails on empty field #34102
Comments
Could you check that the problem is not the pattern. ie its trying to check if the empty value matches the regex in the pattern |
the pattern works in J3 (saving with empty value gives no error) and gives this behavior in J4, so the issue is not in the pattern, but in the handling of the pattern |
I am surprised it works in j3 because the pattern is a validation rule and an empty field doesnt match the pattern |
anyway if you use type=email then the browser does it for you |
sure, but this is an example of what seems like a B/C. There are patterns developers use that are not in the type list :) |
unless I am very much mistaken html5 pattern validation is done by the browser not joomla |
You are mistaken (sorry), issue is in validate.js because it returns a false, the error is thrown. So somebody with knowledge of JS should have a look at line 685 of file ./media/system/js/fields/validate.js |
This comment was marked as abuse.
This comment was marked as abuse.
this is just a simple test to show the B/C issue with J4 form field validation :) #noworries |
Closing as there is PR #34124. |
Steps to reproduce the issue
In order to be able to reproduce this follow the below instruction (otherwise I had to create a component that needed to be installed).
<field name="email" type="text" pattern=".*@.*\..*" label="TESTFIELD" description="" />
Expected result
Configuration should save (TESTFIELD is empty and NOT required)
Actual result
save action throws error:
The form cannot be submitted as it's missing required data.
Please correct the marked fields and try again.
System information (as much as possible)
J4 dev 8 (nightly)
PHP 8.05
mysql 8.0.25
Additional comments
saving with this field and (empty) value works correct in J3
The text was updated successfully, but these errors were encountered: