CRM-11185 contribution create function doesn't check for error

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 4.2.4
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      When I try to import contributions with duplicate transaction ids, I get an error:

      PHP Fatal error: Call to undefined method CRM_Core_Error::fields() in /var/aegir/platforms/poniatowska-ourpowerbase-d7-c4.2/sites/all/modules/civicrm/api/v3/utils.php on line 664

      It's because the api create function doesn't check to see if the object it is returning is an error or not.

        Attachments

          Activity

          [CRM-11185] contribution create function doesn't check for error
          Jamie McClelland added a comment -

          Eileen - would you mind reviewing my patch? Not sure if or xav are the right person for this.

          Eileen McNaughton added a comment -

          Jamie - that seems fine - we are trying to make all API calls throw an exception rather than return an error - however - we don't seem to have gotten very far on making that change

          e.g. from Relationship....

          throw new Exception("contact_id not valid: $value");

          Eileen McNaughton added a comment -

          Hi Jamie,

          I would really like to 'lock' this in with a Unit test - error handling is going to change fairly frequently in the next few releases I think. Do you have a way to generate the underlying core error that we can add a test for? (or course there's always the risk we'll fix it & then...)

          Coleman Watts added a comment -

          Jamie McClelland what's the status of this?

          Jamie McClelland added a comment -

          This looks like ancient history to me. I don't see any patch (despite my comment) and I don't seem to be carrying a patch in our version of PowerBase and we haven't hit this issue since it was opened so I think it's either worskforme or just not a high enough priority to worry about.

          Coleman Watts added a comment -

          Thanks for following up

            People

            • Assignee:
              Jamie McClelland
              Reporter:
              Jamie McClelland

              Dates

              • Created:
                Updated:
                Resolved: