I've just started using Webform Autosave and it does seem to be working quite well for the most part, but I did run into one issue. Most of my fields are fairly traditional webform fields, but the very first field on my form is a webform_image_select type of field (one of the submodules of the Webform project). The autosave doesn't seem to happen fully on that particular field. After the user selects the image, I do see a draft submission saved but the value for this first field is empty. If I continue to move through the form and save values into the subsequent fields, those are saved as expected AND the value of the first field is saved successfully. Is there anything I can do to ensure that that very first image field selection value is saved, even if the user doesn't fill out fields 2, 3, etc.?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

attheshow created an issue. See original summary.

rymcveigh’s picture

Version: 2.0.1 » 2.0.x-dev
Component: Miscellaneous » Code
Assigned: Unassigned » rymcveigh
Category: Support request » Bug report

This looks to be a bug. I created a test webform on a vanilla Drupal 10 website. The autosave functionality worked except for the image select element. I suspect it is because the JS listener is not triggering when the image is selected. I altered the category of this issue to be a bug.

rymcveigh’s picture

Status: Active » Needs review
StatusFileSize
new7.65 KB

To get the listener to work on the select performed by the image picker jQuery library, we needed to add a change event listener to selects. I added the listener to the attached merge request. I've attached the config yaml for the test webform I created when working on this issue.

attheshow’s picture

Status: Needs review » Reviewed & tested by the community

This looks like it's working quite well! Thanks so much for your help!

Sorry, I have one additional question (and please feel free to let me know if I need to open an additional support request). I'm wondering about the initial draft when the user first views the form. Is there any way to turn that off until they've made at least one selection in the form? Right now it seems to be saving a draft before they've even interacted with anything.

  • rymcveigh committed f5e73248 on 2.0.x
    Issue #3391755 by attheshow: Autosaving After Change to...
rymcveigh’s picture

Status: Reviewed & tested by the community » Fixed

Is there any way to turn that off until they've made at least one selection in the form? Right now it seems to be saving a draft before they've even interacted with anything.

Unfortunately we need to have a draft to save to before a selection is made. We explored this in issues #3145769 and #3103887

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.