Skip to content

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

@fpcorso

Description

@fpcorso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions