Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.5
-
Fix Version/s: 4.4.0
-
Component/s: Drupal Integration Modules
-
Labels:
Description
When we set the 'property_type' parameter as an 'integer' in the definition of the civicrm_contact_ref_contact field type in civicrm_contact_ref_field_info(), the entity module knows how to handle these fields (so we can eg. set/get these with rules).
Source: second paragraph at https://drupal.org/node/1156554:
"To support a new field type it sometimes suffices to specify the data type your field has to be mapped to - this is done with the 'property_type' key in hook_field_info(). With that information some default information is generated, which is already fine for most field-types that use only one db-column."
Function in civicrm_contact_ref.module should become:
/**
- Implemetation of hook_field_info
*/
function civicrm_contact_ref_field_info() { return array( 'civicrm_contact_ref_contact' => array( 'label' => t('CiviCRM Contact'), 'description' => t('Reference a CiviCRM contact.'), 'default_widget' => 'options_select', 'default_formatter' => 'civicrm_contact_ref_link', 'property_type' => 'integer', ), ); }
For know, you can use this without patching the module:
/**
- Implements hook_field_info_alter().
*/
function <your-module-name>_field_info_alter(&$info) { $info['civicrm_contact_ref_contact']['property_type'] = 'integer'; }