Form block: Duplicating a form does not create a unique entity #33009
Labels
[Block] Contact Form
Form block (also see Contact Form label)
Customer Report
Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report"
[Feature] Contact Form
[Feature] Forms Blocks
Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc.
[Platform] Atomic
[Plugin] Jetpack
Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
[Pri] Low
[Status] In Progress
[Status] Stale
Triaged
[Type] Bug
When a feature is broken and / or not performing as intended
Impacted plugin
Jetpack
Quick summary
If you want to have multiple unique forms on a single page, duplicating (or copy/pasting) an existing Form block may be the fastest method to do so. However, in some cases, duplicating a form causes both copies to be treated as the same entity with the same ID/hash. On submission, the forms generate the same output, matching the last duplicate copy (or last updated copy), even if the forms have different fields.
Steps to reproduce
A clear and concise description of what you expected to happen.
Despite being duplicated, I expect both forms should be unique entities. Filling out Form A should yield a submission with Form A's information, and same for Form B.
What actually happened
In some cases, the two forms are treated as two copies of the same form. Submissions follow the format/fields list for the duplicate copy (or last updated copy?); when submitting the original form, any unique fields in that form are lost, and any fields present in the duplicate but not in the original are present and empty.
Example 1: Duplicate form has a new field added. On submission, even the original form shows this field.
Example 2: Duplicate form has a field removed ("message"). On submitting the original copy (with a "message"), that info is lost.
On inspecting the Forms in the browser inspector, both forms have the same
contact-form-hash
.Of note: some changes seem to cause the duplicate Form to obtain a new ID/hash and be treated as a new entity. I think any change to the Form block itself (not the inner blocks/fields) does this.
Impact
Some (< 50%)
Available workarounds?
Yes, easy to implement
Platform (Simple and/or Atomic)
Atomic
Logs or notes
Only consistent workaround is to rebuild the duplicated forms from scratch. Making changes to the Form blocks themselves (the parent block) might also fix things.
The text was updated successfully, but these errors were encountered: