soulseekah/Gravity-Forms-Saved-Forms-Addon

GravityForms - 'Saved Forms Add-on' - Troubleshooting

Closed this issue · 9 comments

Hello,
This thread is related to the following GF Add-on: https://github.com/soulseekah/Gravity-Forms-Saved-Forms-Addon

I installed the plugin on 3 different forms - it works well on one of the forms. I am trying to narrow down the faulty parts

Form: http://www.simplyinc.us/online-app-page-long/

Please create an account to access the form: http://www.simplyinc.us/wp-login.php?action=register

Problem: This form shows the SAVE button but it only saves two fields of the form: the address and checkbox fields... nothing else

The form has about 70 questions and uses conditional logic. It uses about 20 different form types (drop down, checkboxes, single line text, etc)

If you require admin access, please send me an email at: artists 4 peace @ g m a i l .com

Thanks in advance!!

A new lead with the latest version of the plugin in debug mode has been unveiled:

Warning: Invalid argument supplied for foreach() in wp-content/plugins/gravityforms-savedforms/gravityforms-savedforms.php on line 106

This is thrown inside try_restore_saved_state wherein the $form['fields'] are iterated through and each field tries to populate it depending on its type choosing between single-part and multi-part types. So there is a field type that has $field['inputs'] set to something that is not null, but is not an array either.

Pending further investigation.

I just resolved this foreach error by entering one more condition to the if in the line 94

if ( $form_part['inputs'] === null || $form_part['inputs'] === "") { /* single-part */

Some times it just returns a empty string. You can check with a empty or so, I was hurry when I did this. Sorry for no pull request or something, I'm far from my computer.

@Juaumlol thanks for your input; however, this does not explain why and when this happens, so potentially something is going to be missing from the saved form, which I'd rather have covered rather than simply ignored.

of course what I did was just a walktrough so my form could work. If I found something more I tell you.

@Juaumlol your form spewed out the same error? Can you contact me so I can investigate on your server if possible? I'd like to do some live debugging as I've not been able to reproduce this.

That was not my form It was a friends form that I just happen to fix doing this. Maybe I can tell him to contact you. Where he can contact you?

gennady[at]kovshenin.com please, thank you!

Your proposed fix seems fine actually, @Juaumlol. Looks like a Gravity Forms 1.7 change, because 1.6 returns a null for 'inputs' instead of an empty string. Doing some final tests and will patch this thing up with your suggested fix. Thanks for your contribution.

glad I could help