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 Profiles (Moderator: Dave Greenberg) »
  • Profiles - Duplicates causing database error
Pages: [1]

Author Topic: Profiles - Duplicates causing database error  (Read 2099 times)

gg66

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Profiles - Duplicates causing database error
August 13, 2008, 12:49:25 pm
Hi,

I've set up a profile for volunteers and I'm using a standalone form to collect information. In settings I've turned the "Update contact on a duplicate match?" on and then tried it turned off. I still get an error when I submit an email address that is already contained in the database even when I'm not checking for duplicates. 

Sorry. A non-recoverable error has occurred.

DB Error: already exists

Database Error Code: Duplicate entry 'me@myemail.com-1' for key 4, 1062

Any advice much appreciated...

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profiles - Duplicates causing database error
August 13, 2008, 03:49:23 pm
Please try and replicate on the 2.1 sandbox - http://sandbox.civicrm.org
thx!

(also, when you post back include the full error - usually it includes the query being attempted; also the version of CiviCRM you are using)
Protect your investment in CiviCRM by  becoming a Member!

gg66

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Re: Profiles - Duplicates causing database error
August 14, 2008, 06:57:39 am
Sorry I should have stated, I'm using CiviCRM 2.0.4. with Drupal 5.

I don't think I can replicate this in sandbox as it uses standalone forms, I tried..

The error occurred when I was logged in and trying to complete the same standalone profile form twice (updating data for same user).

Once logged out it worked fine and I could sign up again and it would override existing data if set to do so.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Profiles - Duplicates causing database error
August 14, 2008, 08:17:47 am
I'm not sure I understand the behavior you're trying to achieve. Using a standalone form to have authenticated users update their info may not be the best approach as this "mode" doesn't allow CiviCRM to load in existing values from the logged in user's contact record. For updates by logged in users it might be best to use the profile in built-in mode. Just link logged in users to it w/ the following URL and it will pre-populate their existing values:

http://<your site>/civicrm/profile/edit?gid=N&reset=1 (where N is the profile ID)

If this approach isn't right for you - then best to explain exactly what you want to accomplish for unauth folks, and auth/existing users. Also we'd need to see what fields are in the profile, the steps u take to get the error, the full DB query error and the profile setting when the error is thrown.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Profiles - Duplicates causing database error

This forum was archived on 2017-11-26.