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

API in 4.4.4 does not return custom fields unless the request filters by those fields

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.4
    • Fix Version/s: 4.5
    • Component/s: CiviCRM API
    • Labels:

      Description

      Perform this query:
      civicrm_api('Contact', 'get', Array('version'=>'3', 'return' => 'custom_2', 'id'=>1));

      Receive this result:
      Array
      (
      [is_error] => 0
      [version] => 3
      [count] => 1
      [id] => 1
      [values] => Array
      (
      [1] => Array
      (
      [contact_id] => 1
      [id] => 1
      )

      )

      )

      Notice that the custom_2 field is not returned.

      However, this call:
      civicrm_api('Contact', 'get', Array('version'=>'3', 'return' => 'custom_2', 'custom_2' => 'Committed', 'id'=>1));

      Returns this:
      Array
      (
      [is_error] => 0
      [version] => 3
      [count] => 1
      [id] => 1
      [values] => Array
      (
      [1] => Array
      (
      [contact_id] => 1
      [civicrm_value_custom_contact_fields_1_id] => 2548
      [custom_2] => Committed
      [id] => 1
      )

      )

      )

      Notice that the custom field is properly returned.

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              jeffmikels Jeff Mikels
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified