ECA can't set default form field value for webform Date element

Created on 7 July 2024, 6 months ago
Updated 11 July 2024, 5 months ago

Problem/Motivation

Trying to set a default form field value using the action "Form field: set default value" results in malformed input HTML.

Steps to reproduce

1. Install the latest drupal, eca, bpmn_io, eca_webform, webform
2. Build a very simple webform with only one Date element and just give it a name, don't change the default settings. (With Date/time element everything seems to work fine).

3. Build a very simple ECA model with one event (Build form) and one action (Form field: set default value)

4. Go to webform and refresh the page. The default value is not set and the input HTML is malformed.

Thanks!

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇷🇴Romania gge

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

Comments & Activities

  • Issue created by @gge
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Webforms are not using Drupal's form API, that's why the form events in eca_form are never dispatched when working with a webform.

    The eca_webform modules comes with some webform specific event. Maybe the Alter submission form event is working in this scenario? You should then also add some message actions into your model so that you can test if the event is being dispatched and also after the action plugin to see if that action got executed successfully as well.

  • 🇷🇴Romania gge

    Webforms are not using Drupal's form API, that's why the form events in eca_form are never dispatched when working with a webform.

    My initial thought was the same but ECA 2 works very well with webforms, just like with entity forms. All form events (build, processing, afterbuild), conditions, actions (defaut values, access to fields, requiring fields etc.), tokens, rendering views, adding ajax handlers to fields and manipulate them, changing submit button label, etc... It can even manipulate address fields inside webforms.
    It's a wonderful and unexpected combination for those who want/need to use something else instead of nodes.

    The only thing (untill now) that doesn't work for me is to manipulate the default value of Date field type. A workaround could be the Date/Time field that come with webform. ECA manipulate this type of field very well so I decided to use it instead of date (and hide the time input).

    Thank you very much for this integration!

Production build 0.71.5 2024