Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.8
-
Fix Version/s: 4.6.9
-
Component/s: CiviContribute
-
Labels:
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
The fix to CRM-16824 causes a regression. Imported contributions that are matched by email (rather than contact ID/external ID) to fail. The error message is: "Empty Contact and External ID. Row was skipped."
First I replicated the bug and confirmed it was not present in Civi 4.5. Next I reviewed CRM/Contribute/Import/Parser/Contribution.php and tracked the problem down to the line added by the most recent commit:
https://github.com/civicrm/civicrm-core/blob/4.6/CRM/Contribute/Import/Parser/Contribution.php#L263
If you look at this block of code a little further down in the function, you'll see that this causes that param to be sent through to
_civicrm_api3_deprecated_check_contact_dedupe($paramValues), which flags the imported record as an error:
https://github.com/civicrm/civicrm-core/blob/4.6/CRM/Contribute/Import/Parser/Contribution.php#L459-L466
This code is very difficult to understand (I suspect it's on the toxic code list, or not far from it). Other than reverting CRM-16824, I'm not sure what to do. Removing lines 459-461 would also probably do the trick - but I'm unclear why a contact_type is defined here at all, so that might raise its own set of issues.