CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • expected behavior of duplicate match processing on contrib forms
Pages: [1]

Author Topic: expected behavior of duplicate match processing on contrib forms  (Read 1429 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
expected behavior of duplicate match processing on contrib forms
August 02, 2010, 10:54:16 am
What is the expected behavior of contact matching on "in honor of" Honoree contributions, or contributions in general?  

Does the duplicate individual strict rule have anything to do with the process, or is this an incorrect assumption?

Does civicrm simply use email to match duplicates on contribution forms?  Searching the code, I cannot find an easy answer.

The reason I ask: It seems that contribution forms will match a contact based on email.  However, even if the default strict duplicate match tool is set to match on first/last, Honoree contributions will not detect a match.  
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: expected behavior of duplicate match processing on contrib forms
August 02, 2010, 06:54:04 pm

check:

CRM/Contribute/BAO/Contribution.php, function createHonorContact

seems like the fuzzy rule is used (not sure why)

Also i think there might be a bug in there and we'll need to add:

                $honorParams['check_permission'] = false;

to allow the entire DB to be searched. I'll check with deepak on this in a few hours

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: expected behavior of duplicate match processing on contrib forms
August 02, 2010, 10:29:52 pm
FTP: filed an issue here - http://issues.civicrm.org/jira/browse/CRM-6575.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: expected behavior of duplicate match processing on contrib forms
August 04, 2010, 08:24:05 pm
So is duplicate checking always using the "individual fuzzy" rule?  Or does it vary by situation?

Can someone provide some insight as to when the "strict" rule and "fuzzy" rules are used by Civicrm for duplication checking on form submit?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: expected behavior of duplicate match processing on contrib forms
August 04, 2010, 11:02:54 pm
The convention is that the default STRICT rule is used for matching for public facing forms (e.g. online contribution pages, online registration, create profiles) AND for "unattended" batch operations (e.g. Import). The default FUZZY rule is used for attended back-office forms where we can give the user a heads up that there is a potential duplicate and they can decide what to do about it (e.g. Add / Edit Contact, create new contact while adding contribution, case etc.).

If there are exceptions to this, they are bugs IMO.
HTH
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: expected behavior of duplicate match processing on contrib forms
August 05, 2010, 11:29:47 am
the In Honor/In Memory uses the Fuzzy rule according to Lobo.  Interesting.  That's why I was so confused, because like you I thought the strict rule was the one used for public facing form.s  thanks
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: expected behavior of duplicate match processing on contrib forms
August 05, 2010, 12:13:06 pm

can u file an issue and we'll take a look and fix for 3.3 / 3.2.x

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: expected behavior of duplicate match processing on contrib forms
August 05, 2010, 12:56:08 pm
done
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: expected behavior of duplicate match processing on contrib forms
August 05, 2010, 04:00:21 pm

hey stoob:

can u please check this patch and see if it works for you:

Code: [Select]
Index: CRM/Contribute/BAO/Contribution.php
===================================================================
--- CRM/Contribute/BAO/Contribution.php (revision 29050)
+++ CRM/Contribute/BAO/Contribution.php (working copy)
@@ -735,19 +735,21 @@
                               'last_name'     => $params["honor_last_name"],
                               'prefix_id'     => $params["honor_prefix_id"],
                               'email-Primary' => $params["honor_email"] );
-        if ( !$honorId ) {
-            require_once "CRM/Core/BAO/UFGroup.php";
+        if ( ! $honorId ) {
             $honorParams['email'] = $params["honor_email"];
-            $honorParams['check_permission'] = false;
-            $ids = CRM_Core_BAO_UFGroup::findContact( $honorParams, null, 'Individual' );
-            $contactsIds = explode( ',', $ids );
-           
-            if ( is_numeric( $contactsIds[0] ) && count ( $contactsIds ) ==  1 ) {
-                $honorId = $contactsIds[0];
-            }
+
+            require_once 'CRM/Dedupe/Finder.php';
+            $dedupeParams = CRM_Dedupe_Finder::formatParams($honorParams, 'Individual');
+            $dedupeParams['check_permission'] = false;
+            $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
+
+            // if we find more than one contact, use the first one
+            $honorId  = CRM_Utils_Array::value( 0, $ids );
         }
         
-        $contact =& CRM_Contact_BAO_Contact::createProfileContact( $honorParams, CRM_Core_DAO::$_nullArray, $honorId );
+        $contact =& CRM_Contact_BAO_Contact::createProfileContact( $honorParams,
+                                                                   CRM_Core_DAO::$_nullArray,
+                                                                   $honorId );
         return $contact;
     }
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • expected behavior of duplicate match processing on contrib forms

This forum was archived on 2017-11-26.