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) »
  • Handling duplicate emails
Pages: [1]

Author Topic: Handling duplicate emails  (Read 1433 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Handling duplicate emails
March 04, 2008, 02:11:16 pm
We have members who share a household and an email. When updating their details, CiviCRM will fail with the following error:

Code: [Select]
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => UPDATE  civicrm_uf_match  SET uf_id = 1250 , uf_name = 'xxx@xxx' , contact_id = 13922 , domain_id = 1   WHERE (  civicrm_uf_match.id = 8832 )   [nativecode=1062 ** Duplicate entry 'xxx@xxx-1' for key 4]
    [type] => DB_Error
    [user_info] => UPDATE  civicrm_uf_match  SET uf_id = 1250 , uf_name = 'xxx@xxx' , contact_id = 13922 , domain_id = 1   WHERE (  civicrm_uf_match.id = 8832 )   [nativecode=1062 ** Duplicate entry 'xxx@xxx-1' for key 4]
    [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_uf_match  SET uf_id = 1250 , uf_name = 'xxx@xxx' , contact_id = 13922 , domain_id = 1   WHERE (  civicrm_uf_match.id = 8832 )   [nativecode=1062 ** Duplicate entry 'xxx@xxx-1' for key 4]"]
)
[/code]

This is because CiviCRM wants the email to be unique for each contact - as does Drupal for each contact from v5 onwards.

Given that this is the case, I wonder if anyone else has worked around the issue, which currently prevents us from saving some contacts details. I'd like to hear your thoughts / methodology.

I'm thinking that I could do something like the following:

  • In preProcess hook, search and identify if a duplicate entry for that _uf_match exists.
  • If so, then create an address of the format contact_id@internal.domain
  • Via Exim+MySQL, reroute messages sent to that domain to their correct destination

Any thoughts?? Anyone got a better idea?
« Last Edit: March 04, 2008, 02:12:52 pm by xurizaemon »
@xurizaemon ● www.fuzion.co.nz

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

This forum was archived on 2017-11-26.