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 CiviContribute (Moderator: Donald Lobo) »
  • Changing Payjunction processors email updates the uf_match table - CiviCRM 2.0.4
Pages: [1]

Author Topic: Changing Payjunction processors email updates the uf_match table - CiviCRM 2.0.4  (Read 1566 times)

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Changing Payjunction processors email updates the uf_match table - CiviCRM 2.0.4
July 24, 2008, 06:14:34 am
Hi.

  I'm not sure if this is a bug or valid behaviour but i noticed something strange when making test contributions.

Environment - Drupal 5.8, CiviCRM 2.0.4

1 - Create a payment processor of type "Payjunction"
     http://wiki.civicrm.org/confluence/display/CRMDOC/PayJunction+Configuration

2 - Create a contribution page using the payment processor created in step 1.

3 - Login to drupal
    in my case i have only one user in drupal - "admin" with uid 1.
    and it's corresponding contact in civicrm - cid 102.
    now all the tables - drupal.users, civicrm.email and civicrm.uf_match are having the same email "user1@example.com" in the respective fields

3 - Login to drupal as admin

4 - Make a test contribution using the contribution page created in step 2.
     Please note while making a contribution there's a field that captures email
     which is prefilled with user1@example.com
     change that to user2@example.com

5 - Complete the test contribution and notice that the tables drupal.users, civicrm.email and civicrm.uf_match
     have now been updated with the email user2@email.com.

Is this the correct behaviour ?

Another case is lets say we have 2 users in drupal and civicrm

drupal                                                          civicrm
id  name    email                                          cid
4   user1    user1@email.com                       104
5   user2    user2@email.com                       105

Now if user1 attempts to make a contribution using payjunction but enters email user2@email.com (user1 is not aware that there's
an email user2.email in the system) then there's a civicrm error for duplicate id for uf_match table.

------------------------------------------------------------------------------------------------------------
Sorry. A non-recoverable error has occurred.
DB Error: already exists
Database Error Code: Duplicate entry 'user2@example.com-1' for key 3, 1062
------------------------------------------------------------------------------------------------------------

Are these correct behaviours when using the payjunction payment processor ? (i.e. updating system records when the email is
changed for that particular contribution ?)

Thanks

Yashesh
« Last Edit: July 24, 2008, 06:30:41 am by yasheshb »

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: Changing Payjunction processors email updates the uf_match table - CiviCRM 2.0.4
July 24, 2008, 11:54:24 am

yes, this is valid behavior. When a logged in user changes his email in the contribution form, we change it in the contribution record and populate it in other places also.

the error is a bug. can you please file an issue and also a patch against 2.0/2.1 for it. The patch needs to ensure that for logged in users, there is no account with the same email address

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

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Re: Changing Payjunction processors email updates the uf_match table - CiviCRM 2
July 25, 2008, 12:02:34 am
hi.

i've created / resolved the issue at http://issues.civicrm.org/jira/browse/CRM-3350.
i still find it very strange that a single email change in a contribution can change my drupal tables :(.
i mean there's no where on the form where it states that your drupal email would be changed.

for the patch i'm checking if the email exists in the civicrm_email table, if present, it gives an error message.
does one also need to check drupal's user table ? (or joomla's ?)

thx.

yashesh

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Re: Changing Payjunction processors email updates the uf_match table - CiviCRM 2
July 25, 2008, 12:07:57 am
There's a bug in the patch. Looking into it. Am not checking if the email belongs to the currently signed in contact id.

sorry.

yashesh

yasheshb

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Re: Changing Payjunction processors email updates the uf_match table - CiviCRM 2
July 25, 2008, 01:45:38 am
it's fixed now. it checks for anonymous / authenticated user now and checks authenticated users against the civicrm_uf_match table.

yashesh

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Changing Payjunction processors email updates the uf_match table - CiviCRM 2.0.4

This forum was archived on 2017-11-26.