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

Nasty fatal if you try to create a contribution via the api with an invoice id matching an existing

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.4.3
    • Component/s: None
    • Labels:
      None

      Description

      This would be a NICE one for someone @ the sprint writing their first UNIT TEST

      Fix is to alter the _civicrm_api3_basic_create to deal with the possibilty of a CRM_Core_Error having been returned - something like this but this is not giving the actual error message.

      This can be reproduced in a test by creating the same contribution twice in a row with the same invoice id.

      In the longer term we should through exceptions rather than returning an error in the BAO

      if (is_null($bao))

      { return civicrm_api3_create_error('Entity not created (' . $fct_name . ')'); }

      elseif (is_a($bao, 'CRM_Core_Error'))

      { throw new API_Exception($bao->getMessages()); }

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: