From 3e3ed70fde63259c5571011d45c4dfd87a2512f4 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:48:25 +1300 Subject: [PATCH] DOC Document stop supporting getCMSValidator() (#667) --- en/08_Changelogs/6.0.0.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/en/08_Changelogs/6.0.0.md b/en/08_Changelogs/6.0.0.md index 981015e3..f7ebe5e2 100644 --- a/en/08_Changelogs/6.0.0.md +++ b/en/08_Changelogs/6.0.0.md @@ -960,6 +960,12 @@ The `extendValidationResult()` method and the `updateValidationResult` extension > [!IMPORTANT] > As part of this change method signature of `FormField::validate()` changed so that it no longer accepts a parameter, and not returns a `ValidationResult` object instead of a boolean. +### `getCMSValidator` method no longer supported {#getcmsvalidator} + +In a `DataObject` subclass, you used to be able to implement a `getCMSValidator()` method and return a [`Validator`](api:SilverStripe\Forms\Validation\Validator) for validating edit form submissions in the CMS. + +This is no longer supported. Instead, you should override the [`DataObject::getCMSCompositeValidator()`](api:SilverStripe\ORM\DataObject::getCMSCompositeValidator()) method as described in [validation in the CMS](/developer_guides/forms/validation/#validation-in-the-cms). + ### Most extension hook methods are now protected {#hooks-protected} Core implementations of most extension hooks such as `updateCMSFields()` now have protected visibility. Formerly they had public visibility which meant they could be called directly which was not how they were intended to be used. Extension hook implementations are still able to be declared public in project code, though it is recommended that all extension hook methods are declared protected in project code to follow best practice.