Skip to content
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

Additional configuration for Url, Ip and Email fields #11445

Open
6 tasks
emteknetnz opened this issue Oct 24, 2024 · 0 comments
Open
6 tasks

Additional configuration for Url, Ip and Email fields #11445

emteknetnz opened this issue Oct 24, 2024 · 0 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Oct 24, 2024

Work done in #11403 add support for FieldValidators, such as UrlFieldValidator and IpFieldValidator as well some new corresponding fields such as DBUrl, DBIp and DBEmail

These new fields validators could benefit from having some additional configuration options:

  • UrlFieldValidator could benefit from being able to specify allowable schemes e.g. ['http', 'https', 'ftp']
  • IpFieldValidator could benefit from being able to specify the symfony constraint to use e.g. Ip:V4, Ip:V6
  • EmailFieldValidator could benefit from being able to specify symfony Email validation mode

Acceptance criteria

  • Developers are able to specify the allowable URL scheme in private static $db e.g. 'MyURL' => 'URL(50, ("http", 'https", "ftp"))' or whatever format makes sense
  • The same can be done with IP e.g. "'MyIP' => 'IP(32, v4)', or whatever makes sense
  • The same can be done with Email e.g. "MyEmail => 'Email(64, strict)', or whatever makes sense
  • DBField FieldValidation matches what is specified in the DB schema
  • FormFields are autoscaffoled with the FieldValidation that matches
  • UrlField::validate() is updated to use UrlFieldValidator
This was referenced Oct 24, 2024
@emteknetnz emteknetnz changed the title Additional configuration for Url and Ip fields Additional configuration for Url, Ip and Email fields Oct 29, 2024
@emteknetnz emteknetnz modified the milestone: Silverstripe CMS 6.1 Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant