Ajax-refresh options using views selection handler if arguments use submission tokens

Created on 12 September 2022, almost 3 years ago
Updated 11 June 2023, about 2 years ago

Problem/Motivation

If a webform options element uses a views selection handler, and the view arguments use webform submission tokens (e.g. [webform_submission:values:field_1:raw]), then it would be nice to refresh the element when the webform element referenced in the token is changed. e.g. if Field A uses views selection handler with argument [webform_submission:values:field_b:raw], then refresh Field A with the new view results when Field B is changed.

Proposed resolution

Attached patch adds ajax updating to views-based entity options elements when elements used in the arguments change.

Remaining tasks

There's an 'Illegal choice detected' error in Test mode - the value seems to be set as a random string instead of using an option from the views results.

✨ Feature request
Status

Closed: won't fix

Version

6.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada bgilhome Victoria

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

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    There seems to no interest in this feature request and the current solution is breaking existing tests.

    Please reopen this ticket is existing tests can be fixed and the feature can include additional test coverage.

  • πŸ‡¬πŸ‡§United Kingdom lexsoft London

    This is a great feature, the patch still works, the value for views selection handler with argument needs to be [webform_submission:values:field_b:entity:id] if field_b is an entity_select type.

Production build 0.71.5 2024