Skip to content

Commit cb595a7

Browse files
talldanmatticbot
authored andcommitted
Fix form validation with js disabled (#41947)
* Only add the $page query param to form submission url when the form is multipage * changelog Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13535850362 Upstream-Ref: Automattic/jetpack@ba1ee78
1 parent 11a1929 commit cb595a7

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.39.1-alpha] - unreleased
9+
10+
This is an alpha version! The changes listed here are not final.
11+
12+
### Fixed
13+
- Forms: Fix 404 error when a user submits an invalid form with JavaScript disabled.
14+
815
## [0.39.0] - 2025-02-24
916
### Changed
1017
- Forms: Add Tracks when connecting Google Drive. [#41825]
@@ -857,6 +864,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
857864
- Added a new jetpack/forms package [#28409]
858865
- Added a public load_contact_form method for initializing the contact form module. [#28416]
859866

867+
[0.39.1-alpha]: https://github.com/automattic/jetpack-forms/compare/v0.39.0...v0.39.1-alpha
860868
[0.39.0]: https://github.com/automattic/jetpack-forms/compare/v0.38.0...v0.39.0
861869
[0.38.0]: https://github.com/automattic/jetpack-forms/compare/v0.37.1...v0.38.0
862870
[0.37.1]: https://github.com/automattic/jetpack-forms/compare/v0.37.0...v0.37.1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@automattic/jetpack-forms",
4-
"version": "0.39.0",
4+
"version": "0.39.1-alpha",
55
"description": "Jetpack Forms",
66
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/forms/#readme",
77
"bugs": {

src/class-jetpack-forms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class Jetpack_Forms {
1717

18-
const PACKAGE_VERSION = '0.39.0';
18+
const PACKAGE_VERSION = '0.39.1-alpha';
1919

2020
/**
2121
* Load the contact form module.

src/contact-form/class-contact-form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public static function style_on() {
249249
* @return string HTML for the concat form.
250250
*/
251251
public static function parse( $attributes, $content ) {
252-
global $post, $page; // $page is used in the contact-form submission redirect
252+
global $post, $page, $multipage; // $page is used in the contact-form submission redirect
253253
if ( Settings::is_syncing() ) {
254254
return '';
255255
}
@@ -346,7 +346,7 @@ public static function parse( $attributes, $content ) {
346346
} else {
347347
// Submit form to the post permalink
348348
$url = get_permalink();
349-
if ( $page ) {
349+
if ( $multipage && $page ) {
350350
$url = add_query_arg( 'page', $page, $url );
351351
}
352352
}

0 commit comments

Comments
 (0)