From 67da00a61e2f551ca60f24ba575a3d824c792314 Mon Sep 17 00:00:00 2001 From: Mark Conroy Date: Wed, 18 Dec 2024 14:12:33 +0000 Subject: [PATCH 1/2] sets form to no-validate, so we can use Drupal validation instead --- localgov.profile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/localgov.profile b/localgov.profile index af6aafa..c8d037c 100644 --- a/localgov.profile +++ b/localgov.profile @@ -5,6 +5,8 @@ * Enables modules and site configuration for a Localgov site installation. */ +use Drupal\Core\Form\FormStateInterface; + /** * Implements hook_page_attachments(). */ @@ -45,3 +47,10 @@ function localgov_post_install_task(): void { $hook(); }); } + +/** + * Implements hook_form_alter(). + */ +function localgov_form_alter(&$form, FormStateInterface $form_state, $form_id) { + $form['#attributes']['novalidate'] = 'novalidate'; +} From 7b301ab0b10a96e351a224737412ba118fa83273 Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 16 Jan 2025 01:47:03 +0800 Subject: [PATCH 2/2] Add return type to address PHP static analysis check. --- localgov.profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localgov.profile b/localgov.profile index c8d037c..bd521e3 100644 --- a/localgov.profile +++ b/localgov.profile @@ -51,6 +51,6 @@ function localgov_post_install_task(): void { /** * Implements hook_form_alter(). */ -function localgov_form_alter(&$form, FormStateInterface $form_state, $form_id) { +function localgov_form_alter(&$form, FormStateInterface $form_state, $form_id): void { $form['#attributes']['novalidate'] = 'novalidate'; }