From 84e17a81b66ceaf9fc27adee1deda2e0abb31c0c Mon Sep 17 00:00:00 2001 From: ekes Date: Tue, 4 Feb 2025 14:19:31 +0100 Subject: [PATCH 1/4] Disable HTML5 form validation by default #503 Discussion: https://github.com/localgovdrupal/localgov_core/pull/267#issuecomment-2618854939 and before. --- composer.json | 1 + localgov.info.yml | 1 + localgov.install | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/composer.json b/composer.json index 73a78ec..b22687f 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "drupal/gin_login": "^2.0.3", "drupal/gin_toolbar": "^1.0 || ^2.0", "drupal/entity_browser": "^2.9", + "drupal/disable_html5_validation": "^2.0", "drupal/masquerade": "^2.0", "drupal/preview_link": "^2.1@alpha", "drupal/redirect": "^1.10", diff --git a/localgov.info.yml b/localgov.info.yml index dc32a24..e0ae8c5 100644 --- a/localgov.info.yml +++ b/localgov.info.yml @@ -37,6 +37,7 @@ install: - entity_browser:entity_browser - gin_login:gin_login - gin_toolbar:gin_toolbar + - disable_html5_validation:disable_html5_validation - masquerade:masquerade - preview_link:preview_link - redirect:redirect diff --git a/localgov.install b/localgov.install index 933ff2b..17dc43b 100644 --- a/localgov.install +++ b/localgov.install @@ -95,3 +95,12 @@ function localgov_update_9503() { } } } + +/** + * Disable HTML5 form validation by default. + * + * To re-enable client side validation disable the module. + */ +function localgov_update_9504() { + \Drupal::service('module_installer')->install(['disable_html5_validation']); +} From 6f0367eeff21fe95abd034ed879d6a03b195cf16 Mon Sep 17 00:00:00 2001 From: Stephen Cox Date: Tue, 18 Feb 2025 11:56:57 +0000 Subject: [PATCH 2/4] Only test against Drupal 10 for now --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72246ae..bee9fcf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: jobs: tests: - uses: localgovdrupal/localgov_shared_workflows/.github/workflows/test-module.yml@1.x + uses: localgovdrupal/localgov_shared_workflows/.github/workflows/test-module.yml@1.x-d10 with: project: 'localgovdrupal/localgov' project_path: 'web/profiles/contrib/localgov' From 654e0f40c088cb97ca95d88dae000a986d15762f Mon Sep 17 00:00:00 2001 From: Stephen Cox Date: Tue, 18 Feb 2025 12:18:49 +0000 Subject: [PATCH 3/4] Add return type to localgov_update_9504 --- localgov.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localgov.install b/localgov.install index 17dc43b..7adff37 100644 --- a/localgov.install +++ b/localgov.install @@ -101,6 +101,6 @@ function localgov_update_9503() { * * To re-enable client side validation disable the module. */ -function localgov_update_9504() { +function localgov_update_9504(): VOID { \Drupal::service('module_installer')->install(['disable_html5_validation']); } From a942ae7e427e37044f2ca0e0a195818f5e1cfe49 Mon Sep 17 00:00:00 2001 From: Stephen Cox Date: Tue, 18 Feb 2025 12:38:16 +0000 Subject: [PATCH 4/4] /VOID/void/ --- localgov.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localgov.install b/localgov.install index 7adff37..aacb3bc 100644 --- a/localgov.install +++ b/localgov.install @@ -101,6 +101,6 @@ function localgov_update_9503() { * * To re-enable client side validation disable the module. */ -function localgov_update_9504(): VOID { +function localgov_update_9504(): void { \Drupal::service('module_installer')->install(['disable_html5_validation']); }