Webform 7.x-4.0-rc3
Webform CiviCRM 7.x-4.6
Show "Save draft" button ON
Automatically save as draft between pages ON

I have a Webform CiviCRM multi page for an Event Registration.
When the user access the webform after the submission, the fields in the first page are correctly populated, but from the second page on all the fileds are empty

Comments

colemanw’s picture

Can you please give more detail about how to reproduce this?
Can you reproduce it with a simple form or does it only affect event registration?

sluc23’s picture

I could reproduce it with a multipage webform only with Contact fields.
I think the option Automatically save as draft between pages is involved. Is this is not enabled all the fields in every page are populated correctly after submission, but once I enable it, after the second page the fields are empty.

I couldn't to test with latest webform 7.x-4.0-rc5 and webform_civicrm 7.x-4.7 releases yet

baergaj2’s picture

I can reproduce this issue.

Webform 7.x-4.1
Webform CiviCRM Integration 7.x-4.9
Show "Save draft" button ON
Automatically save as draft between pages ON

1. Create a new form with Contact 1 Email Field
2. Put Email Field after a page break
3. View form while logged in
4. Click on next page
5. Email is blank

colemanw’s picture

So what's happening here is that the draft webform submission is getting saved as soon as the user clicks "next" even though this module hasn't had the chance to process anything > page 1.
Solution might be to hook into the draft saving mechanism and insert Civi data so it will be there for subsequent pages.
Anyone want to step up to provide code or funding for this?

colemanw’s picture

Priority: Major » Minor

Downgrading priority. If you'd like to see this issue truly become a "Major" priority for me, please help in terms of funding or work.

baergaj2’s picture

I would be happy to help!

Can you point me to some example hook code?

Any direction you can give me would be appreciated.

Feel free to contact me directly - andrew.baerg at gmail.com

colemanw’s picture

I'd suggest you start by checking out this module from git, and take a look through the wf_crm_webform_preprocess code. Note how it modifies the form only under certain conditions (not if the "back" button was clicked, for example). I can think of a few different solutions to try:
- Alter values on unseen pages when saving a draft
- Change the logic in fillForm() to detect whether a page has been seen before, even if it appears to be filled
- Maybe store something in the webform_civicrm_submissions table to indicate which pages have not yet been seen?

danielstrum’s picture

Hi Coleman,

I would love to discuss sponsoring you to get CiviCRM integration working with Webform's "Save a draft" functionality. Perhaps other could chip in also? Might you have the time to look into this?

Thanks.

colemanw’s picture

I would estimate this to be a 5-10 hr project. Rates are here: https://civicrm.org/work-core-team
What are folks able to chip in? Ideally we need a commitment for the whole amount in order to do the work.

danielstrum’s picture

Hi Coleman,

Thanks for your reply. I think I could get the organization I am working for to first become a member ($200) then put another $300 towards this project. Are there others who could also chip in?

Sohal Khatwani’s picture

Hi Danielstrum & Coleman,

Our company could possibly chip in as well. I know it has been a while since the last message. So was wondering where this issue is at.

Cheers.

colemanw’s picture

Thanks for your question Sohal.

This is a small-medium sized job (I think 10 hours is a more accurate estimate) and not really worth the effort of launching a crowd-funding campaign (and such a campaign is unlikely to get any response). If the two of you are able to pool your resources and provide the necessary funding, please submit this to https://civicrm.org/paid-issue-queue and we can get it taken care of.

danielstrum’s picture

Hi Sohal & Coleman,

I actually found that for my purpose, multi-page forms were not best. I am now using collapsible field-sets instead. However, within the next 6 months I might need to create a much larger, more complex civi-webform for the same client and perhaps a similar one for a second client. At that point I might be able to convince these clients to sponsor this development.

Sohal, if your company would be willing now to sponsor the majority of this work, I might be able to raise a few hundred dollars by convincing my clients that this is a good investment because it will offer us more options moving forward.

Best,
Daniel

mpaulson’s picture

Status: Active » Closed (outdated)

This issue was filed against a branch (7.x-4.x) that is no longer supported. We're sorry we did not get to work through it, but once you upgrade to 7.x-5.x and if the issue persists, please feel free to re-open.