Webform support

Created on 15 May 2020, over 4 years ago
Updated 21 March 2024, 9 months ago

It would be nice if this module supports Webform https://www.drupal.org/project/webform
It would provide a vast improvement over the Webform default "Term checkboxes" element, certainly for longer and/or more nested term lists

Feature request
Status

Needs review

Version

1.0

Component

User interface

Created by

🇧🇪Belgium PieterDC Ghent

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom mistergroove

    This is great. Can this be added to a release?

  • 🇨🇦Canada teknocat

    Damn, I just did my own thing from scratch in my own custom module before seeing this. However, I went a slightly different way by extending the OptionsBase webform field type and using WebformEntityReferenceTrait and WebformEntityOptionsTrait. I started by looking at what the Webform Entity Checkboxes field type did, then figured out how to use the bits of that that made the most sense to turn it into a checkbox tree using this module.

    I'll create an issue fork and submit a merge request with my idea so everyone can review and figure out what makes the most sense.

  • Merge request !25Issue #3137046 - Webform support → (Open) created by teknocat
  • 🇨🇦Canada teknocat

    So it seems that this widget simply doesn't function fully, with either patch #4 or the version I've put together in my branch. The default value can never seem to be set, nor does it return the selected value(s) correctly in the webform.

    Inspecting the rendered form reveals why - the field name has some complexities to it that will require the implementation of setValueCallback and getValueCallback in the webform element class. This is taken care of in the Term Reference Tree widget for use with fieldable entities, so that needs to be replicated for the webform module.

    I'll try to get this figured out and comment when I've got something that actually works.

  • 🇨🇦Canada teknocat

    The last several commits to my issue fork seem to have this now working fully. Some things from patch #4 were correct and thus incorporated.

    I have tested a form using test values, then edited the submission and the widget seems to be working so far.

Production build 0.71.5 2024