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

API: Contribution is_test doesn't work

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.6.8
    • Fix Version/s: Unscheduled
    • Component/s: CiviCRM API
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      Make a call such as:

      $params = array(
      'return' => "id",
      'invoice_id' => $invoice_id,
      'contribution_status_id' => "Pending",
      'is_test' => 1
      );
      $result = civicrm_api3('Contribution', 'get', $params);

      And you get zero results. This is because the SQL query that gets fired actually ends up having contribution_test = 0 AND is_test = 1 in the WHERE clause. I'm guessing it expects contribution_test as the correct parameter name.

      So if instead of the parameter 'is_test' you put
      'contribution_test' => 1
      then it works as expected and returns results.

      In the API explorer it gave me the 'is_test' parameter to put in there, so that got me tripped. It would be nice to either fix this in the API explorer/documentation or in the actual API implementation. Whichever suits better.

        Attachments

          Activity

            People

            • Assignee:
              saurabh.batra Saurabh Batra
              Reporter:
              borislavzlatanov Borislav Zlatanov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: