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

Donations with an On Behalf Of an organization profile dedupes with contacts in the trash

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5.4
    • Fix Version/s: 4.6
    • Component/s: CiviContribute
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      Contributing on behalf of an organization where there's a duplicate that's been deleted and in the trash, and the contact number is sequentially prior to the kept contact record, the contribution and other information collected with the profile are attributed to the duplicate, deleted contact.

      I've fixed this using the API (below), as I wasn't sure how to pass an is_deleted = 0 parameter into the Core DAO method used.

      diff --git a/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php b/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
      index 3a04db6..96f5b0d 100644
      — a/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
      +++ b/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php
      @@ -276,7 +276,19 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
      $this->_params['organization_id'] = $this->_params['onbehalfof_id'];
      }
      else

      { - $this->_params['organization_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_params['onbehalf']['organization_name'], 'id', 'display_name'); + $api_onbehalf = civicrm_api3( + 'Contact', + 'get', + array( + 'sequential' => 1, + 'return' => "id", + 'contact_type' => "Organization", + 'organization_name' => $this->_params['onbehalf']['organization_name'], + 'is_deleted' => 0, + ) + ); + $this->_params['organization_id'] = $api_onbehalf['values'][0]['contact_id']; }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yashodha Yashodha Chaku
                Reporter:
                jlacey Joseph Lacey
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: