Skip to content

Conversation

@GuySartorelli
Copy link
Owner

@GuySartorelli GuySartorelli commented Apr 10, 2025

Brings this module into compatibility with CMS 6.

Breaking changes include:

  • RegexFieldsValidator removed. Use ConstraintsValidator with a Regex constraint instead.
  • SimpleFieldsValidator removed. Form::validate() will call FormField::validate() without the need for an additional validator. See AjaxCompositeValidator docs for how to omit fields from AJAX validation.
  • RequiredFieldsValidator removed - use the RequiredFieldsValidator from framework instead.
  • GridFieldMessagesExtension removed as it's no longer necessary.
  • DataObjectDefaultAjaxExtension removed - use injector configuration instead.
  • FormFieldExtension removed - we can't control when validate() is called on fields anymore, since that's happening directly in the form.
  • Added strong typing
  • Extension hook methods are now protected so can't be called directly on the object being extended

@GuySartorelli GuySartorelli marked this pull request as draft April 10, 2025 23:45
Form::validate() now handles this directly, so we can't change that
functionality by replacing a single validator anymore.
- `GridFieldMessagesExtension` is no longer relevant because the bug it
  was working around was fixed.
- `DataObjectDefaultAjaxExtension` is no longer relevant because the
  `new` keyword is no longer used for instantiating composite
validators, so we can rely on injector config now.
- Update FQCN for classes that moved
- Improve typehinting
- Remove unnecessary phpdocs
- Some minor code quality improvements
This doesn't really add anything that isn't part of the one that comes
with framework anymore. The main reason for this was to avoid double
validation of fields, but that's not a problem in framework anymore.
@GuySartorelli GuySartorelli force-pushed the cms6 branch 2 times, most recently from 2494175 to f0d5fa8 Compare June 12, 2025 22:53
@GuySartorelli GuySartorelli marked this pull request as ready for review June 13, 2025 01:08
@GuySartorelli GuySartorelli merged commit 1014fcc into 3 Jun 13, 2025
22 checks passed
@GuySartorelli GuySartorelli deleted the cms6 branch June 13, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant