From 00a25dce8b0cfb4e0b218362914d02b888b5eb72 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 13 Jul 2023 12:37:18 -0400 Subject: [PATCH] FIX Tighten routing rule for userforms ping action --- _config/routes.yml | 2 +- code/Form/UserForm.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/_config/routes.yml b/_config/routes.yml index 531352ded..6cb936ab7 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -4,4 +4,4 @@ After: framework/routes#coreroutes --- SilverStripe\Control\Director: rules: - UserDefinedFormController//$Action: SilverStripe\UserForms\Control\UserDefinedFormController + UserDefinedFormController//ping: SilverStripe\UserForms\Control\UserDefinedFormController diff --git a/code/Form/UserForm.php b/code/Form/UserForm.php index c9ecf5dec..9110f92e6 100644 --- a/code/Form/UserForm.php +++ b/code/Form/UserForm.php @@ -173,6 +173,7 @@ public function getRequiredFields() ->Fields() ->filter('Required', true) ->column('Name'); + $requiredNames = array_merge($requiredNames, $this->getEmailRecipientRequiredFields()); $required = UserFormsRequiredFields::create($requiredNames); $this->extend('updateRequiredFields', $required);