advancedforms / advanced-forms

WordPress plugin to create forms using Advanced Custom Fields
75 stars 14 forks source link

the new function: af_save_field_to_post does not work with ACF clone fields #10

Closed asitemade4u closed 7 years ago

asitemade4u commented 7 years ago

Please see comments at the end of the closed #5 issue. I did a thorough testing on that.

fabianlindfors commented 7 years ago

Thanks again for looking into this!

I didn't have the clone field in mind while creating the new helper function and it doesn't really work as intended with cloned fields. I have been looking into this for a little while now and I'm closing in on a solution.

Will push a commit as soon as I have found a solution. Full support for clone fields would be great. :)

asitemade4u commented 7 years ago

Thank you SO MUCH Fabian, you are saving my day again.

Yes, clone fields are very powerful and full of potential. I sent you a private email on the subject.

asitemade4u commented 7 years ago

Another weird side-effect of the clone fields is that the Selects do not work at all:

asitemade4u commented 7 years ago

Hi Fabian, any update on the subject of Clone fields?

asitemade4u commented 7 years ago

Hi Fabian, Another part of the plugin that does not work with the Cloned Fields: when defining the email to send after the form is submitted:

fabianlindfors commented 7 years ago

Hi!

I just pushed a commit (f24b919434312d9055e7a22368b32a4e2de83d2c) with some fixes for clone fields. I have tried to fix the problems with getting values from clone fields and saving them with af_save_field_to_post. I have barely had any time to test it out so it would be great if you could try it and give some feedback!

These changes do not fix the issues with emails and selecting recipients. Going to have to check that out next. :)

asitemade4u commented 7 years ago

Thanks Fabian, will test this afternoon!

asitemade4u commented 7 years ago

I have proceeded with the tests and it worked partially:

What still DOES NOT work:

fabianlindfors commented 7 years ago

Thanks for testing!

Could you provide me with a screenshot of your field group configurations and the code used to save your form?

asitemade4u commented 7 years ago

Hi Fabian, Will do better when I am back: will let you access the staging website as an admin. Please provide your private email so that I can forward credentials.

fabianlindfors commented 7 years ago

Hi again!

I've rewritten the way field parsing and saving is handled in the new version 1.2.0. It now closely mimics the way ACF works to ensure compatibility.

Thanks to this change clone fields also work much better. Values of clone fields can be retrieved using af_get_field and they can also be saved directly to a post using af_save_field_to_post. With the testing I have done it seems to work.

One thing to note is that when using af_save_field_to_post you must pass the actual clone fields name and not the individual cloned fields (all cloned fields will be saved). It's a bit inconvenient but I hope to solve it in an upcoming release.

Feel free to test it out if you have the time. I hope it solves the problems you were having. :)

fabianlindfors commented 7 years ago

Closing because of inactivity. Should be fixed since 1.2.0.