- Issue created by @jude.hungerford
1.0 Problem/Motivation
If you have an Existing Contact field associated with locked fields, searching for a contact by a number and then pressing Create New will not create the contact.
2.0 Detailed steps to reproduce (embed screenshots)
3.0 Proposed resolution
The problem is essentially the same as this issue relating to the D7 version of webform_civicrm, and it's caused by an equivalent bit of code:
https://www.drupal.org/project/webform_civicrm/issues/3358082 🐛 Existing Contact - Create New failure after numeric search with locked fields Active
The issue is caused by this line:
https://github.com/colemanw/webform_civicrm/blob/6.x/src/WebformCivicrmP...
It can be solved by changing it to this:
if (!$existing_contact_val[0] || ((is_numeric($existing_contact_val[0]) && ((int)$existing_contact_val[0] > 0)))) {
Active
6.2
CiviCRM Data Handling