Check entity type is set on webform settings before compare
Overview
Webforms with phones and selectable type are not retrieving data from contacts on webform load. The user sees as if no information was previously saved and once the user saves data (if any) will be overwritten.
Before / How it works currently
Same Initial data. Showing type and location for phone.
-
Retrieving phone data without checking existence of type index on webform settings causes data to be seen as different from the webform configuration, thus not showing any phone related data at all from the contact.
https://github.com/colemanw/webform_civicrm/pull/146
After applying PR-
Repeat steps 1 to 3 from "Before".
-
Information is now retrieved correctly, producing expected results on save.
Technical Details
-
Attaching exported webform with node export: webform-phone-with-selectable-type.txt
-
Site created for testing with civibuild using this command
civibuild create civi12 --type drupal-demo --civi-ver 4.7.27 --url http://civi12 --web-root /home/beto/buildkit/build/civi12
-
CiviCRM currently uses civicrm_webform 7.20, however this module was replaced with the last version found here https://github.com/colemanw/webform_civicrm