From 18c3758b56fdd005bf855bdaf83a8b882aa2eb6a Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 21 Feb 2025 16:08:55 +0800 Subject: [PATCH 1/2] Only add the $page query param to form submission url when the form is multipage --- .../packages/forms/src/contact-form/class-contact-form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/packages/forms/src/contact-form/class-contact-form.php b/projects/packages/forms/src/contact-form/class-contact-form.php index 5f51e6747390a..f649ea9c3e7b1 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form.php +++ b/projects/packages/forms/src/contact-form/class-contact-form.php @@ -249,7 +249,7 @@ public static function style_on() { * @return string HTML for the concat form. */ public static function parse( $attributes, $content ) { - global $post, $page; // $page is used in the contact-form submission redirect + global $post, $page, $multipage; // $page is used in the contact-form submission redirect if ( Settings::is_syncing() ) { return ''; } @@ -346,7 +346,7 @@ public static function parse( $attributes, $content ) { } else { // Submit form to the post permalink $url = get_permalink(); - if ( $page ) { + if ( $multipage && $page ) { $url = add_query_arg( 'page', $page, $url ); } } From ca9ac9a401a9b68d8171c8c5778f942292e98487 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 21 Feb 2025 17:20:43 +0800 Subject: [PATCH 2/2] changelog --- .../forms/changelog/fix-form-validation-with-js-disabled | 4 ++++ .../jetpack/changelog/fix-form-validation-with-js-disabled | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 projects/packages/forms/changelog/fix-form-validation-with-js-disabled create mode 100644 projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled diff --git a/projects/packages/forms/changelog/fix-form-validation-with-js-disabled b/projects/packages/forms/changelog/fix-form-validation-with-js-disabled new file mode 100644 index 0000000000000..c62b7f9952d1a --- /dev/null +++ b/projects/packages/forms/changelog/fix-form-validation-with-js-disabled @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Forms: Fix 404 error when a user submits an invalid form with JavaScript disabled. diff --git a/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled b/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled new file mode 100644 index 0000000000000..7830d76e77574 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Forms: Fix 404 error when a user submits an invalid form with JavaScript disabled.