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

PCP account creation fails if contact already exists

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.4
    • Fix Version/s: 4.4.5
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      To recreate this bug setup the following scenario:
      1. check the site is using the default unsupervised rule of 'email'
      2. create a new, unique individual contact whose email does not already exist in db tables: civicrm_email, civicrm_uf_match nor drupal's users table
      3. enable PCP for a contribution page, using the default 'Supporter Profile'
      4. logout
      5. visit http://domain.com/civicrm/contribute/campaign?action=add&reset=1&component=contribute&pageId=X where X is the id# of the contribution page
      6. enter the name and email of the contact created in step 2 and submit

      IMPORTANT: This error does NOT occur when "Require e-mail verification when a visitor creates an account." is checked under Drupal Account Settings.

      The following error occurs:
      ----------------------------------------
      Database Error Code: Duplicate entry 'something@mydomain.com-1' for key 'UI_uf_name_domain_id', 1062

      Additional Details:

      Array

      (

      [callback] => Array

      (

      [0] => CRM_Core_Error

      [1] => handle

      )

      [code] => -5

      [message] => DB Error: already exists

      [mode] => 16

      [debug_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 , 871 , 'something@mydomain.com' , 46854 ) [nativecode=1062 ** Duplicate entry 'something@mydomain.com-1' for key 'UI_uf_name_domain_id']

      [type] => DB_Error

      [user_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 , 871 , 'something@mydomain.com' , 46854 ) [nativecode=1062 ** Duplicate entry 'something@mydomain.com-1' for key 'UI_uf_name_domain_id']

      [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 , 871 , 'something@mydomain.com' , 46854 ) [nativecode=1062 ** Duplicate entry 'something@mydomain.com-1' for key 'UI_uf_name_domain_id']"]

      )

      -------------
      This error does not occur if the contact doesn't already exist. The error does not occur on a standalone profile with 'account creation' unrelated to PCPs. It seems to be an error related to PCP's code that is attempting to insert the contact twice into civicrm_uf_match. Regardless the account is created, the but error prevents a person from continuing on to create their PCP.

        Attachments

          Activity

            People

            • Assignee:
              stoob Stoob
              Reporter:
              stoob Stoob
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: