Closed 0xElectric closed 11 months ago
Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.0.39"
.
@engram-design it looks like this is fixed now for forms that aren't cached, but I'm still getting the unload warning when I have cache breaking JS in use. If I comment out the cache busting code, the reload warning goes away.
@jwrudzin Are you using the brand new refreshForCache
JS function, or are you rolling your own? If the latter, ensure that you're refreshing the form's hahed data.
If you're using the former, I might need some more information, as that's not something I can replicate.
@engram-design I'm using the new refreshForCache
JS function. I did some additional testing, and running Formie 2.0.39
, I get the reload prompt whether the cache busting JS is in place or not. Once I upgrade to dev-craft-4
, I do not get the reload prompt without the cache busting JS, but when the cache busting JS is in place I get prompted every time.
Something else to note - when running dev-craft-4
and with the JS cache busting in place, I get the reload prompt whether the duplicate captcha is enabled or not.
This is on a page with 5 total forms. 1 is unique, the other 4 are duplicates of the same form.
Here's my cache busting JS, in case it's helpful (it comes just after the call to renderForm
):
% js "https://cdn.polyfill.io/v2/polyfill.js?features=fetch,Promise" %}
{% js %}
// Formie Cache Busting
document.addEventListener('onFormieInit', (event) => {
// Fetch the Form Factory once it's been loaded
let Formie = event.detail.formie;
// Refresh the necessary bits that are statically cached (CSRF inputs, captchas, etc)
Formie.refreshForCache('{{ form.formId }}');
});
{% endjs %}
@engram-design I just wanted to add, it seems that this is related to the honeypot captcha. When I disable the honeypot captcha (even with the JS captcha and duplicate captcha enabled, and cache bust code in place), the reload warning goes away.
Ah yes, the Honeypot captcha behaves differently now (it's fixed from not working correctly), which causes this. Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.0.39"
.
Fixed in 2.0.40
Describe the bug
Steps to reproduce
Form settings
Craft CMS version
Craft Pro 4.5.9
Plugin version
2.0.39
Multi-site?
No
Additional context
No response