Skip to content

Fix: Form Builder: Submit form to the URL it was displayed on - #1215

Draft
n7studios wants to merge 1 commit into
fix-form-builder-multiple-forms-validationfrom
fix-form-builder-current-url
Draft

n7studios wants to merge 1 commit into
fix-form-builder-multiple-forms-validationfrom
fix-form-builder-current-url

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

Fixes the Form Builder block submitting to the Post's permalink, instead of the page the form was displayed on.

The form's action was always get_permalink() of the Post containing the block. If the block was displayed elsewhere, such as a blog archive showing full post content, submitting the form took the visitor away from that page to the Post. There, the order of Form Builder blocks can differ, so the validation error from #1212 may not display on the submitted block.

Forms now submit to the URL they were displayed on, excluding the ck_subscriber_id query parameter. A successful submission with no redirect configured also returns the visitor to that URL, rather than the Post's permalink. If the request URI isn't available, the Post's permalink is used, as before.

Testing

New Integration test in BlockFormBuilderMultipleFormsTest:

  • testFormActionIsCurrentURL: the form's action is the current URL, with ck_subscriber_id removed and other query parameters kept. Fails without this fix.

Checklist

@n7studios n7studios added this to the 3.4.6 milestone Oct 2, 2026
@n7studios n7studios self-assigned this Oct 2, 2026
@n7studios n7studios added the bug label Oct 2, 2026
@n7studios n7studios changed the title Form Builder: Submit form to the URL it was displayed on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant