From 545931234bdbdd2ad41c26aa811b4ab1a9269637 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 5 Dec 2024 17:21:01 +1300 Subject: [PATCH] API Deprecate renamed validator --- code/Form/UserFormsRequiredFields.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/Form/UserFormsRequiredFields.php b/code/Form/UserFormsRequiredFields.php index 0d7c4b38f..e36a5822d 100644 --- a/code/Form/UserFormsRequiredFields.php +++ b/code/Form/UserFormsRequiredFields.php @@ -9,6 +9,7 @@ use SilverStripe\Forms\RequiredFields; use SilverStripe\ORM\ArrayLib; use SilverStripe\UserForms\Model\EditableFormField; +use SilverStripe\Dev\Deprecation; /** * An extension of RequiredFields which handles conditionally required fields. @@ -19,9 +20,17 @@ * * Required fields will be validated as usual. * Conditionally required fields will be validated IF the display rules are satisfied in the submitted dataset. + * + * @deprecated 5.4.0 Will be renamed to SilverStripe\UserForms\Form\UserFormsRequiredFieldsValidator */ class UserFormsRequiredFields extends RequiredFields { + public function __construct() + { + Deprecation::noticeWithNoReplacment('5.4.0', 'Will be renamed to SilverStripe\\UserForms\\Form\\UserFormsRequiredFieldsValidator', Deprecation::SCOPE_CLASS); + parent::__construct(...func_get_args()); + } + /** * Allows validation of fields via specification of a php function for * validation which is executed after the form is submitted.