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

Form submission cookies are not being set for some form integrations #886

Closed
fpcorso opened this issue Oct 14, 2020 · 0 comments · Fixed by #889
Closed

Form submission cookies are not being set for some form integrations #886

fpcorso opened this issue Oct 14, 2020 · 0 comments · Fixed by #889
Labels
Milestone

Comments

@fpcorso
Copy link
Contributor

fpcorso commented Oct 14, 2020

Describe the bug

Originally discussed in Slack
If you set a form submission cookie and turn on the only in popup setting, the cookie does not get set when using Formidable Forms. This is caused by the form variable that is passed to our formSubmission method no longer existing as Formidable Forms removes the form prior to calling the success event.

However, our cookies system uses PUM.getPopup( form ).length && PUM.getPopup( form ).is( $popup ) to check before setting the cookies: https://github.com/PopupMaker/Popup-Maker/blob/master/assets/js/src/site/plugins/pum-cookies.js#L90

Site information

Popup Maker version: 1.12.0
WordPress version: 5.5.1
PHP version: 7.4.1

Steps to reproduce

  1. Add Formidable Forms form to popup
  2. Add new "Form Submission" cookie with "Only in popup" enabled
  3. Submit form. Cookie will not be set.

Proposed Solution

In the formSubmission method, we set the args.popup key to be the popup too using popup: PUM.getPopup(form), if that key doesn't exist. We set that here: https://github.com/PopupMaker/Popup-Maker/blob/master/assets/js/src/site/plugins/pum-integrations.js#L44

To solve other problems, we are now passing the popup key from formidable forms. So, we should have the cookies system check that key instead of the forms parameter since that key is also set correctly in all other form integrations.

@fpcorso fpcorso added this to the v1.13 milestone Oct 14, 2020
@fpcorso fpcorso linked a pull request Oct 19, 2020 that will close this issue
11 tasks
@fpcorso fpcorso closed this as completed Oct 19, 2020
@fpcorso fpcorso changed the title Some form submission cookies are not being set for some form integrations Form submission cookies are not being set for some form integrations Oct 22, 2020
@fpcorso fpcorso mentioned this issue Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant