State Province Id lost after validation

Created on 11 June 2025, about 2 months ago

1.0 Problem/Motivation

After selecting CRM field State/Province on webform and submitting form, field value is lost if other field return error and form is not submitted.
Country is selected but this field is empty

2.0 Detailed steps to reproduce (embed screenshots)

Simple as it is, add contact to form with full address and submit form, add other field that return error after submit, s form will not process.

3.0 Proposed resolution

This fix problem for me. Question is: should it be done better ?

webform_civicrm/src/FieldOptions.php:32

elseif ((strpos($name, 'state_province_id') !== false) || (isset($field['type']) && $field['type'] === 'civicrm_number')) {

to

elseif (isset($field['type']) && $field['type'] === 'civicrm_number') {
🐛 Bug report
Status

Active

Version

6.3

Component

Webform/Drupal

Created by

🇵🇱Poland artur.smigielski

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

Comments & Activities

Production build 0.71.5 2024