From 2f250c7a11689d54896532573f3cf433f060a5f4 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 11 Dec 2024 15:32:08 +1300 Subject: [PATCH 1/2] ENH Do not call form field validate in validator --- code/Form/UserFormsRequiredFieldsValidator.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/Form/UserFormsRequiredFieldsValidator.php b/code/Form/UserFormsRequiredFieldsValidator.php index d19307dd..9db401b8 100644 --- a/code/Form/UserFormsRequiredFieldsValidator.php +++ b/code/Form/UserFormsRequiredFieldsValidator.php @@ -35,12 +35,6 @@ public function php($data) $valid = true; $fields = $this->form->Fields(); - foreach ($fields as $field) { - $result = $field->validate(); - $valid = $result->isValid() && $valid; - $this->result->combineAnd($result); - } - if (empty($this->required)) { return $valid; } From 2efc5ea424ceb663093ed74cf7692f73342f2367 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:29:12 +1300 Subject: [PATCH 2/2] API Update code to reflect changes in silverstripe/cms (#1356) --- code/Model/Recipient/EmailRecipient.php | 10 +--------- code/Model/UserDefinedForm.php | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index 815b1bd2..b7540b44 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -229,15 +229,7 @@ protected function getFormParent() $formClass = $this->FormClass; return $formClass::get()->byID($this->FormID); } - - // Revert to checking for a form from the session - // LeftAndMain::sessionNamespace is protected. - $sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class; - - $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentPage'); - if ($formID) { - return UserDefinedForm::get()->byID($formID); - } + return null; } public function getTitle() diff --git a/code/Model/UserDefinedForm.php b/code/Model/UserDefinedForm.php index 893385a3..790ab769 100755 --- a/code/Model/UserDefinedForm.php +++ b/code/Model/UserDefinedForm.php @@ -20,7 +20,7 @@ class UserDefinedForm extends Page * @var string * @deprecated 6.4.0 Will be renamed to cms_icon_class */ - private static $icon_class = 'font-icon-p-list'; + private static $cms_icon_class = 'font-icon-p-list'; private static $class_description = 'Adds a customizable form.';