Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple forms save mixup #27

Closed
soulseekah opened this issue Jan 11, 2015 · 2 comments
Closed

Multiple forms save mixup #27

soulseekah opened this issue Jan 11, 2015 · 2 comments
Labels

Comments

@soulseekah
Copy link
Owner

Discovered while looking into #26. All forms with save functionality get the same value saved (or restored) if they're on the same page during submission, depending on which position the form being saved is in. Sometimes the value is written to both forms, other times the value is not saved at all (again, depending on position of form).

image

@soulseekah soulseekah added the bug label Jan 11, 2015
soulseekah added a commit that referenced this issue Jan 14, 2015
Multiple forms on the same page triggered the addition of the save
button several times, bringing chaos. Fixes #26. Note that there are
still issues when saving, the saved form data is being overridden and is
discussed in #27.
soulseekah added a commit that referenced this issue Jan 14, 2015
With several forms on one page we ignore the restore of saved forms if
they're not being interacted with. Due to how Gravity Forms names its
inputs (same for every form) we're unable to set $_POST data for any one
form. This is a workaround for #27
@soulseekah
Copy link
Owner Author

I've decided to disable the restoration of form if it's not being interacted with on the page. Gravity Forms names all inputs in all forms in the same manner (input_1, input_2, etc. regardless of the form) and since we're injecting restore data for a saved form by setting the $_POST forcibly (so it appears in the form) we can no longer set the $_POST for a specific form, resulting in the override of a certain input ID on across forms on a page. All inputs with the same name (for example: name="input_1") are set to the same saved or submitted value.

This is a short-term fix. This issue will stay open as a reminder to find a better way of restoring form data since overriding $_POST is a bad no-no.

@soulseekah
Copy link
Owner Author

This is no longer the case with the newer 1.9 support version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant