Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13171

Adding property_type to the civicrm_contact_ref_contact info.

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.4.0
    • 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'; }

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              wdecraene Wim De Craene
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5 minutes
                5m
                Remaining:
                Remaining Estimate - 5 minutes
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified