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
- Add Formidable Forms form to popup
- Add new "Form Submission" cookie with "Only in popup" enabled
- 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.
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
formvariable that is passed to ourformSubmissionmethod 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#L90Site information
Popup Maker version: 1.12.0
WordPress version: 5.5.1
PHP version: 7.4.1
Steps to reproduce
Proposed Solution
In the
formSubmissionmethod, 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#L44To 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.