#1 September 24, 2014 1:14pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Embeddable Form Submission Error

I just setup my first embeddable form module and I'm getting an error every time I try to submit it. I think I've figured out what the problem is but I'm not sure how to fix it. The problem appears to be in the if ($_POST["_bigtree_hashcash"] != md5($complete_string) test in /core/admin/ajax/auto-modules/embeddable-form/process.php This test fails on each submission resulting in the error message "The form submission failed to pass our automated submission test. If you have JavaScript turned off, please turn it on." I looked in some other files and I found the input that it is comparing the hash value of, _bigtree_hashcash. I think that the problem is that there is no value being placed in this input on the initial load, only a name and id are defined for it. I tried placing <?=$bigtree["form"]["hash"]?> as the value, which is the same hash value used in the URL for the form action but that did not work. Is there another value that needs to be placed in that input or am I just entirely off base?

Thanks

Offline

#2 September 24, 2014 1:18pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Embeddable Form Submission Error

The "hash cash" value is an anti-spam measure. It (ideally) takes all of the values the user is inputting into the form, mixes them together, and calculates a hash from the value via Javascript. That hashed value is then calculated against what the CMS is expecting based on the same values and if they don't match it assumes a bot was filling things out and didn't do the hashing properly.

Can you send me either a public link to the embeddable form via email or a copy of the table and embedded form entry so I can try to replicate it? It's possible one of the field types is failing to properly hash.

Offline

#3 September 26, 2014 10:58am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Embeddable Form Submission Error

Thanks for sending over your setup. Turns out that embedded forms hash validation failed when a field type produced array data (in your case it was the Text field's sub type of Name producing a first_name/last_name array).

I've fixed it in the development branch in this commit:
https://github.com/bigtreecms/BigTree-C … a407399261

It's just a single file change so it's easy to replace in an existing 4.1.1 install. 4.1.2 should be out next week if you'd rather wait, though.

Offline

#4 October 6, 2014 12:33pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: Embeddable Form Submission Error

This fix did work for instances with a text box and a subtype of "Name". However, it doesn't appear to be working with the Array of Items field type. I set up one for my form and the form will submit fine if I don't add any items and leave it blank. If I add any number of items then I get that same original error message and it won't let me submit.

Offline

#5 October 6, 2014 12:34pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Embeddable Form Submission Error

Bummer! I'll look into Array of Items and see what's up with it. Thanks for the feedback!

Offline

#6 October 6, 2014 2:10pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Embeddable Form Submission Error

Ok, I believe I fixed a bunch of issues related to the embedded forms (lots of style related issues with Array of Items and Photo Galleries and validation issues as well). I tested all the individual field types and a couple of custom ones we have in our test environment and they all seem to be working now. Can you grab the 4.1-devel branch and see if it fixes your problem?

https://github.com/bigtreecms/BigTree-C … -devel.zip

Thanks!

Offline

#7 October 6, 2014 2:20pm

jmason03
Member
Registered: January 9, 2014
Posts: 123

Re: Embeddable Form Submission Error

It all works great now!

Thanks again for your continued help on this.

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.