Autosaving After Change to webform_image_select Type of Field

Created on 4 October 2023, 9 months ago
Updated 16 October 2023, 9 months ago

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.?

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States attheshow

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @attheshow
  • Assigned to rymcveigh
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    2 pass
  • @rymcveigh opened merge request.
  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    To get the listener to work on the select created 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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    2 pass
  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    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.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    2 pass
  • Status changed to Fixed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rymcveigh

    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

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

Production build 0.69.0 2024