2

I am getting an error when I import contributions.

I have successfully imported contributions before from other data sets. This dataset is a little more rich and I have now added a 3 custom fields to contain the messaging options that the user can complete. The initial mapping and basic checks pass. However at the step of the actual import, every record fails with the error "Expected one Contribution but found 25"

I have reviewed the mapping and can't see any obvious issues. I have searched stackexchange and the web with no result that seems to relate to my situation.

I would love to hear any ideas. I don't see any records in the CiviCRM log, though maybe there is some further switch I should be enabling to get more information.

In response to a comment, I enabled debugging and backtrace. I ran a test import, but no errors of any kind were thrown into the CiviCRM log in the ConfigAndLog directory. It does log other errors there, so I can only assume that it doesn't see this as an error of that kind. I continue to receive the "Expect one ... found 25" error in the front end output.

The problem occurs as I say in my "Answer" below when I try to use aone of the existing fields to set "Contribution status". I assume and accept that the data is probably incorrect for the column in the db (though I can't find it), but the resulting error makes no sense. I'm fine with that but thought I'd share back into this space since asked and it might be helpoful in clarifying the error that is thrown.

I am running 5.19.3 on WordPress 5.3

  • Could you please turn on Debugging and Backtrace (Administer menu > System Settings > Debugging and Error Handling) and replicate the error, then edit the question to include the full error/backtrace? Also post your CiviCRM version? – Jon G - Megaphone Tech Nov 30 at 20:19
  • Turning on debugging and backtrace should show more details with the "Expected one, found 25" error. Perhaps it's bubbling up from somewhere that isn't passing the extended info. As for the error - somewhere in the code is a Contribution API getsingle call. This error happens most often when a value is missing - e.g. "find me the contribution with an ID of x" normally returns one contact - but if x is blank, it will return ALL contributions. Since the API normally limits to 25, you get this error. – Jon G - Megaphone Tech Dec 3 at 4:49
2

In the absence of clear error information, I went into trial and error mode.

I disabled each mapping in turn. In the end, I found it was the attempt to import "contribution status" that triggered the failure. It is likely that the contents didn't match required values in the database. Though, in this case, the error message seemed to have nothing to do with that. My previous experiences with similar problems generated more clear errors that the content of the field was invalid.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.