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

Sometimes API civicrm_contact_get() does not return custom data fields.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.8
    • Fix Version/s: 3.0
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      We use Drupal 6 + CiviCRM 2.2.8 + custom code. We did not modify Drupal or CiviCRM tables. We did not make mo
      civicrm_contact_get() returned all the values of custom fields provided in the parameters.
      We add or remove a field in any custom data using CiviCRM admin tool without any other modifications.... civicrm_contact_get() (v2) does not return any custom data fields.
      We did the following to solve the problem and it's working:

      CRM_Contact_BAO_Query::apiQuery():

      foreach ($returnProperties as $key=>$value)

      { $fields[$key] = array($key); }

      $query =& new CRM_Contact_BAO_Query( $params, $returnProperties,
      $fields, true, false, 1,
      false, true, $smartGroupCache );

      Just pass $fields to the constructor.
      The extended class is attached.

      It would be useful to allow more parameters for API functions.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              warecorp Warecorp
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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