Bug with confirmation plugin

jfquestiaux

Well-Known Member
On a (multipage) form, if I use the confirmation plugin, I have the following issues:

JS error when clicking on "reedit":
Erreur : TypeError: this.form.submit.click is not a function​
Ligne : 203​
If I submit the form without clicking "reedit", I have the "succes" message but there is no record in the database

if I add a "redirect" plugin, the redirection is not taken into account.

Tested on GitHub 2060.
 
Hmmmm, I'm not sure we can use the confirmation plugin on a multipage form at the moment, without some code refactoring, as the submit button only "exists" on the last page ... I'll raise a github issue on this, see what rob says.

I'm pretty certain we never tested it with multipage forms, and didn't have that in mind when it was written. I looked at the code, and it pretty much assumes a simple, single page form.

However, Rob may be able to wave his magic JavaScript wand and make it work.

https://github.com/Fabrik/fabrik/issues/1223

-- hugh
 
Ooops, forgot to follow up on this one ... I've worked out what's going on, but not how to fix it ... yet.

If you change that line in the JS to this.form.submit() instead of this.form.submit.click() it'll submit, but seems to lose some data. I didn't get far enough last night to work out if that's just the element types I was testing with (like 'link'), or if that's becuase this.form.submit() doesn't do what we need. Which is probably the case, as thinking about it, simulating a click on the submit btn would run doSubmit() ... hmmm ...

-- hugh
 
thanks! if someone finds an answer to this - i can finally put a project behind me - that has haunted me for a while... lol
 
OK, the "Re-edit" submit thing should be fixed as of this commit:

https://github.com/Fabrik/fabrik/commit/0634cf8e3791e6b060e22dfb0d1e335eb2d5cc2e

... although we seem to be losing data for "complex" element, like (for example) links. Elements which involve JSON formatted data. They show up correctly on the confirmation display, but the data disappears when going back to re-edit. Simple elements, like fields, work ok.

I'll continue looking in to it. But after a discussion with Rob, we're both of the opinion that the confirmation plugin was one of those "how hard can it be?" ones when we started it, and the answer has turned out to be "very, very", and that it really needs to be totally re-written from scratch. Which just isn't going to happen any time soon. So ... it's pretty much "as is" for the moment, except for bandaids.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top