Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Sticky Forms not working w/Custom System Messages

Status Resolved
Add-on / Version Custom System Messages 2.6.2
Severity
EE Version 2.11.5

Brett Burwell

Mar 17, 2017

Description:
When a user is filling out a form (in my case, the Solspace User registration form), has an error in their input, is taken to the Custom System Messages Submission Error template, and then hits the back button to return to the form their data is lost / the form fields are all empty.

At first I thought this was a front-end issue, but the only way I’ve been able to reliably make the issue go away is by disabling the Custom System Messages extension and retesting with EE’s standard error message template.

While attempting to debug / work around the issue I’ve tried redirecting to a default Submission Error template (/error/index) and also tried using a Custom Action to redirect back to the same template where the form data is being lost. When using a default template the form data is saved in Chrome and Safari, but is not saved in Firefox or IE. When redirecting back to the same template the form data is not saved in any browser. 

The form I’m having trouble with can be found here:
https://skylinefurnituremfg.com/trade/request-access

I created a quick reduced test case that contains nothing but the Solspace User registration form tags and am seeing the same behavior:
https://skylinefurnituremfg.com/trade/test

The error template doesn’t include anything custom / unique. Here’s the code (minus all the header, footer, and wrapping markup):
{if csm:content}

{csm:heading}

    {csm:content}

« {csm:link}

{if:else}
    {redirect="/"}
{/if}

Detailed steps to reproduce the issue:
1. Go to url above and fill in form. Enter mis-matched passwords to trigger error (the other required fields are caught with front-end validation).
2. Browser is redirected to custom error template.
3. Hit back button to return to form.

I’ve included a login to the staging site below. It’s a mirror copy of the production site, but the client doesn’t have an SSL certificate for it, so I figured it was better to include links to the actual production site when referencing the issue itself. But if you want to login to double-check any config details have at it.

Thanks in advance for taking a look and don’t hesitate to shout if there’s any more info I can pass along that would be helpful.

#1

BoldMinded (Brian)

Try changing the “Redirect to the defined error template?” to no.

#2

Brett Burwell

Thanks for the quick reply Brian. No luck with that change. The form now redirects to the {site_url} on error, but when I click ‘Return to Previous Page’ and return to the form the fields are still blank in Firefox.

#3

BoldMinded (Brian)

CSM doesn’t care about browsers, so lets take that out of the equation. Whatever you’re seeing in each browser is specific to that browser, not CSM. I just tested the form in Chrome and CSM appears to be working as intended.

#4

Brett Burwell

You’re correct, it does work in Chrome. But that doesn’t change the fact that it doesn’t work in Firefox. And when CSM is disabled, the form data isn’t lost in Firefox. As soon as I re-enable CSM and re-test the form data doesn’t save again.

And, as stated above, when I tried testing a Custom Action to use the /trade/request-access template to display the error message (vs. a global default /error/index) the form data was lost in all browsers I tested. So something odd is happening and it appears safe to assume it’s related to CSM.

#5

Brett Burwell

p.s. I totally understand and respect that support issues like this can be the bane of an add-on devs life. And I certainly don’t expect you to go down a rabbit hole trying to sort out some strange cross-browser issue with me.

If you’re 95% sure this isn’t actually related to CSM just let me know (which in itself would be helpful) and I can keep looking into what else might be triggering the issue. I just thought, based on my initial testing, that there was a reasonable chance you would have seen this before and might have a simple fix.

#6

BoldMinded (Brian)

What does your form template look like?

#7

BoldMinded (Brian)

Unless you have the redirect to template option turned on, CSM will not perform any redirects, and honestly doesn’t do anything out of the norm of what native message templates do. CSM uses a hook to load a template file and display its contents in place of the native message templates, thats really it.

Have you tried a fresh install with only CSM installed and used native EE forms to replicate the error? If this is only happening on User forms, then it could be an issue with User. I know you said that it works fine when you un-install CSM, but I’ve seen issues with Solspace add-ons in that they don’t use the native methods of handling errors and redirection in forms.

#8

Brett Burwell

Hi Brian. Thanks for the reply. I’m as mystified with what’s going on as I’m sure you are.

I ended up just removing CSM from the site entirely. It makes me sad to stick all of that repeated code in the User Messages section of the CP (and out of version control), but I don’t have any more time left to chase this weird issue down the rabbit hole.

Thanks again for the followups. I appreciate it.

Login to reply