-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable 'Phone' custom data #147
Conversation
Hmm, that
and then change that unwieldy conditional to read That would also improve this pr to not just work with phones but also emails, etc. |
b66db84
to
990a682
Compare
@colemanw Thankyou for the review. I've updated the PR to use metadata instead of expanding the conditional - I agree that's a much better way. However, I also realised that on create, submitted values are being set (ie. custom data is set for a phone number when creating it via webform). But on update the slightly mysterious (to me) This change (https://github.com/colemanw/webform_civicrm/pull/147/files#diff-59be2e079a691088e15ab3a80e0640a0R2513) allows all submitted values to be updated in CiviCRM - what do you think? |
includes/utils.inc
Outdated
'address' => array('entity_type' => 'contact', 'label' => t('Address'), 'max_instances' => 9), | ||
'phone' => array('entity_type' => 'contact', 'label' => t('Phone'), 'max_instances' => 9), | ||
'address' => array('entity_type' => 'contact', 'label' => t('Address'), 'max_instances' => 9, 'custom_fields' => 'combined'), | ||
'phone' => array('entity_type' => 'contact', 'label' => t('Phone'), 'max_instances' => 9, 'custom_fields' => 'combined'), | ||
'email' => array('entity_type' => 'contact', 'label' => t('Email'), 'max_instances' => 9), | ||
'website' => array('entity_type' => 'contact', 'label' => t('Website'), 'max_instances' => 9), | ||
'im' => array('entity_type' => 'contact', 'label' => t('Instant Message'), 'max_instances' => 9), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above 3 should also be 'combined'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. Done (I'll squash commits once we've completed review)
This is looking good. For the sake of consistency I think we should either add this to the other sets or remove it from the "contact" entity. For now I think let's just do the latter as the property isn't being used for contacts, etc. |
To your question about the |
What @colemanw said - including the bit about |
@powdevel Any thoughts on the change in reorderLocationValues please? |
d506f48
to
db86114
Compare
db86114
to
f4076bd
Compare
Thanks for squashing this @mattwire. Good to go. |
@mattwire sorry it seems I'm the best at missing notifications 😞 |
@powdevel thanks for taking a look. Please let us know what you find. |
Oh, I see the discussion is continued on #148 |
Overview
If you enable custom data for "Phone" entity type in CiviCRM it should be usable in webform_civicrm (enable via cg_extends option group).
Before
Cannot use custom data for "Phone" entity.
After
Can use custom data for "Phone" entity.
Technical Details
This just adds the entity type to a list of allowed types in webform_civicrm
Comments
Tested that "Phone" custom data is loaded, selectable and saved by webform_civicrm (note that you cannot see it in the CiviCRM UI but it can be retrieved via the API.