Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the Form Builder block submitting to the Post's permalink, instead of the page the form was displayed on.
The form's
actionwas alwaysget_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_idquery 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'sactionis the current URL, withck_subscriber_idremoved and other query parameters kept. Fails without this fix.Checklist