- Issue created by @jude.hungerford
- 🇦🇺Australia jude.hungerford
I've discovered an issue with the workaround I've suggested above. When "Submit disabled field value(s)" is enabled, the Contact's name is blanked (in the database) after selecting an existing contact and submitting the form.
Same form setup as described above
Search for an existing contact in the Existing Contact field
Select an existing contact
Submit the form
Observe that the Contact now has blanks for First name and Last nameSo it's not a good workaround, as it causes a different issue.
- 🇦🇺Australia jude.hungerford
In place of the code I've suggested above, I think line 2478 can be changed to:
if (!$existing_contact_val[0] || ((is_numeric($existing_contact_val[0]) && ((int)$existing_contact_val[0] > 0)))) {
If they've selected an actual contact, $existing_contact_val[0] will be positive, whereas if they enter numeric data and press Create New, it will be negative. This might be an acceptable way to differentiate between the two scenarios, though I don't understand enough to be very confident that it's correct.
- 🇦🇺Australia jude.hungerford
Sorry, I've referred to the wrong line in my original comment. It's actually line 2474 which I'm changing locally (also edited above for clarity):
https://github.com/colemanw/webform_civicrm/blob/7.x-5.x/includes/wf_crm...