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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact duplicate rule and CiviEvent registration
Pages: [1]

Author Topic: Contact duplicate rule and CiviEvent registration  (Read 2668 times)

pminf

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.6
  • PHP version: 5.3
Contact duplicate rule and CiviEvent registration
December 09, 2013, 01:42:06 am
I have a problem with CiviEvent registration, profiles and contact duplicate merge rules: When a visitor is registering to an event with an existing e-mail address, the existing related contact will be updated. But I want CiviCRM to create a new contact instead. And the existing contact should only be updated, if name, first name and e-mail address are matching.

I've tested this using the online demo http://drupal.demo.civicrm.org/civicrm/ with the following preferences:

Individual rules for "Merge Duplicate Contacts"
Name and Email (reserved) - Unsupervised
Email (reserved) - Supervised

Existing contact (not registered to this event, but already in contact db):
John Doe, jd@example.com

Visitor (not in contact db)
Max Power, jd@example.com

Event Fall Fundraiser Dinner, Paid Event: No

If Max Power is registering using the e-mail address jd@example.com, the existing contact John Doe will be updated. So after this event registration, there is only one contact with jd@example.com:

Max Power, jd@example.com

But I expected two contacts:

John Doe, jd@example.com
Max Power, jd@example.com

This is an undesired behaviour, because I setup the rule Name and Email as the unsupervised, and Email as supervised.

Is this a bug or did I setup something wrong?
« Last Edit: December 09, 2013, 03:01:52 am by PhilippMikael »

pminf

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.6
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
December 12, 2013, 12:11:22 am
To sum up: individual rules to merge duplicate contacts (http://drupal.demo.civicrm.org/civicrm/contact/deduperules?reset=1) seem to be broken. The unsupervised rule has no impact on the event registration and contact creation process. Can anybody confirm this?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Contact duplicate rule and CiviEvent registration
December 12, 2013, 01:31:01 am
I am looking in to a problem that sounds almost the reverse but also suggests something is amiss with the Duplicate checking rules - just flagging this in case our issue collide or at least provide another perspective - i will be testing this more tomorrow and will report back.
In our case, the reported behaviour is that even despite being logged in, and the form prefilling, when submitting a new record is being created.
my first check showed that there were 2 unsupervised rules for individuals which is clearly an issue.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Contact duplicate rule and CiviEvent registration
December 12, 2013, 07:12:20 am
FWIW - I think petednz's problem may be related to a bug I saw on a 4.4 upgrade.  I did an upgrade on a site that had modified its default duplicate rules, which resulted in NO supervised rule after upgrade.  I think that there's some hardcoded logic around unsupervised rules in the upgrade which could explain both of our problems but I haven't had time to investigate.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pminf

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.6
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
December 13, 2013, 06:10:17 am
We are still using Version 4.3. So our issue is not caused by an update to 4.4.

pminf

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.6
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
January 21, 2014, 12:07:35 am
One month is gone and I have found out, that this problem is only related to event registration forms. If you do NOT check "Allow multiple registrations from the same email address?", the duplicate rules are ignored. Instead the crm is searching for a user with the same e-mail address, who will be updated (name, street address, etc) and registered to this event.

civicrm\CRM\Event\Form\Registration\Register.php, checkRegistration()
Code: [Select]
if ($self->_values['event']['allow_same_participant_emails']) {
  $params = $fields;
  $level = ($isAdditional) ? 'Supervised' : 'Unsupervised';

  $dedupeParams = CRM_Dedupe_Finder::formatParams($params, 'Individual');

  // disable permission based on cache since event registration is public page/feature.
  $dedupeParams['check_permission'] = FALSE;
  $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', $level);
  $contactID = CRM_Utils_Array::value(0, $ids);
}
else {
  foreach ($fields as $fieldname => $fieldvalue) {
    if (substr($fieldname, 0, 6) == 'email-') {
      $emailString = trim($fieldvalue);
      if (!empty($emailString)) {
        $match = CRM_Contact_BAO_Contact::matchContactOnEmail($emailString, 'Individual');
        if (!empty($match)) {
          $contactID = $match->contact_id;
        }
      }
    }
}

If someone (e.g. Max Power, unknown contact) registers to an event with an e-mail address which is already related to a known crm contact (e.g. John Doe), this contact will be overwriten and registered to this event. So this results currupt contact data (e.g. John Doe, who is now undesired named Max Power). I think this is false behaviour and a security issue.

Should the related issue CRM-6996 be reopened or should we create another one?
« Last Edit: January 21, 2014, 12:32:24 am by PhilippMikael »

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Contact duplicate rule and CiviEvent registration
January 21, 2014, 06:22:13 am
On a related note I am trying to edit a de-dupe rule but cannot see how to do this either on our site or the Civi demo. When I select Edit Rule I am taken to a screen which shows the name and status of the rule and a yellow box which states: This reserved rule is pre-configured with matching fields to optimize dedupe scanning performance. It matches on... and lists the fields.

However, there is no way of editing the rule itself from this screen. Am I missing something very obvious?!

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Contact duplicate rule and CiviEvent registration
January 21, 2014, 09:05:34 am
Hi LindseyM,

You basically have to create a new rule and set that as the default instead.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Contact duplicate rule and CiviEvent registration
January 22, 2014, 01:56:12 am
Thanks Jon, but is there a bug which needs fixing? With the 'edit' button existing for de-dupe rules, presumably you must be able to edit them somehow. I know I have in the past.

At present, just looking at the info given for each rule, it tells you what fields you're using (eg email, first name) but it doesn't show you what weighting or length you've allocated... You really do need to see the detail of the actual rule so that you can play about with different scenarios. That's what 'edit' allows you to do but I can't see how to access that at present, even in the demo. Thoughts anyone?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Contact duplicate rule and CiviEvent registration
January 22, 2014, 02:00:53 am
Hi,

If you create your own rule, that's how it works.
I think the rule you are trying to edit is one of the optimised and hardcoded ones, that can't be edited .

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

rminkov

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
January 22, 2014, 03:04:47 am
We also suffer from the problem explained here by PhilippMikael. We struggled with it a lot before finding the "Allow multiple registrations from the same email address?" checkbox.

The thing is that even with this box checked some contacts manage to update their records, like using all lower- or uppercase for the names, contracting company names, etc.

For example - event registration using strict deduplication rule:

Existing contact:
Richard Pools, Personal assistant to the CEO, European Commission, richard.pools@ec.eu

after registering for an event becomes:
richard pools, pa to the ceo, EC, richard.pools@ec.eu

The resulting record could not be used for badges nor for list of participants, so the secretary has to go through the whole list of registrations and fix where needed, and she has to do this for every event (2-3 per week).

The current event registration procedure is:
- when a match is found - update the existing data with the data entered
- when no match is found - create new record

We need it changed to:
- when a match is found - leave the existing data as is
- when no match is found - create new record

How would you recommend to do this? Extension? Hacking the core?


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Contact duplicate rule and CiviEvent registration
January 22, 2014, 07:01:07 am
Hi,

One extension allows to "freeze" the first name and last name (when you send registration links with checksum token or if the participants are logged in).

https://github.com/TechToThePeople/noverwrite

another one that might help you the ALL UPPERCASE french participants like so much for the lastname:
https://github.com/TechToThePeople/civicrm-normalise

and given your example, I'm assuming you're nearby brussels. You should join us for cividay:
https://civicrm.org/civicrm/event/info?reset=1&id=404

X+

P.S. your assumption is that you know better than your participants how they should write their name/job title. Not necessarily a wrong assumption at all, but that can create a shitstorm if one gave you the job title they want but you ignored it and printed another one (I've learn the hard way ;)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

rminkov

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
January 22, 2014, 09:08:29 am
Thank you, Xavier.
I will test the extensions and will give feedback.

See you on the CiviDay in Muntpunt  :)

pminf

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Drupal 7
  • MySQL version: 5.6
  • PHP version: 5.3
Re: Contact duplicate rule and CiviEvent registration
January 27, 2014, 12:32:23 am
I've created an issue (type: bug): Unsupervised contact duplicate rule ignored when "Allow multiple registrations from the same email address" is not checked

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact duplicate rule and CiviEvent registration

This forum was archived on 2017-11-26.