SHS fields with same taxonomy duplicate values on Webform validation failure

Created on 20 March 2025, 3 months ago

Problem/Motivation

When using the SHS field type in a webform, having two fields that use the same taxonomy results in unexpected behavior upon form validation failure. Specifically, if only one of the two fields is populated, then after the page reloads due to validation errors, both fields display the same value. This is incorrect, as each field should retain its own value.

Steps to reproduce

  1. Create a taxonomy vocabulary.
  2. Create a new webform.
  3. Add a field to the webform using the taxonomy (via the SHS field type).
  4. Add a second field to the webform using the same taxonomy (also using the SHS field type).
  5. Populate only the first field and leave the second field empty.
  6. Submit the webform, ensuring that validation fails (e.g., due to other required fields being empty).
  7. On the reload, observe that both taxonomy fields are prepopulated with the value entered in the first field.
πŸ› Bug report
Status

Downport

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΎUruguay jjose.quevedo

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

Comments & Activities

Production build 0.71.5 2024