Author Topic: Problem with drupal accounts linking to civicrm contacts  (Read 764 times)

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Problem with drupal accounts linking to civicrm contacts
« on: January 17, 2012, 03:33:33 am »
I recently created a bunch of new accounts for administrators of my CiviCRM (3.4) install.  However rather than linking them to their own contact record in the database they have been linked to seemingly random contact records.  I was under the impression that linking was done based on email address, so I'm not sure what has gone wrong?  I guess this could be a bug, in which case how am I best to investigate it?

Offline petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3674
  • Karma: 122
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #1 on: January 17, 2012, 10:20:30 am »
hi snowball. sounds odd. pls confirm the steps and outcome

Contact A with xx@yy.com is a civicrm contact with no related Drupal User.

You create a Drupal User - User A - using email xx@yy.com

Outcome: Contact A is not connected to User A, instead User A is connected to User Q who had email cc@dd.com
pete davis : www.fuzion.co.nz : connect + campaign + communicate

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #2 on: January 17, 2012, 10:25:18 am »
Yes, this sounds odd. Can you clarify how you are determining which Contact is associated with which User also?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #3 on: January 17, 2012, 10:37:58 am »
hi snowball. sounds odd. pls confirm the steps and outcome

Contact A with xx@yy.com is a civicrm contact with no related Drupal User.

You create a Drupal User - User A - using email xx@yy.com

Outcome: Contact A is not connected to User A, instead User A is connected to User Q who had email cc@dd.com
That is exactly it.

Yes, this sounds odd. Can you clarify how you are determining which Contact is associated with which User also?
Well users have been complaining that when they go in to civicrm they are being recognised as a user other than themselves.  I double checked this by clicking on the view contact record link on the drupal user page.

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #4 on: January 17, 2012, 10:39:54 am »
Check that your users table is set correctly here: civicrm/admin/setting/uf?reset=1
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #5 on: January 18, 2012, 04:35:10 am »
Check that your users table is set correctly here: civicrm/admin/setting/uf?reset=1
It's set as "users", I assume that is correct?

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #6 on: January 18, 2012, 07:02:19 am »
I can't be certain if that's correct. Can you find the database connection string in sites/default/settings.php and post that? Change the username and password when you post.

What I want to see actually is what the default prefix is set to there. Or if by some wild change there is a unique prefix for users.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #7 on: January 18, 2012, 07:19:20 am »
$db_url['default'] = 'mysqli://####:####@localhost/joehill_ndb_drpl';
$db_url['civicrm'] = 'mysqli://####:####@localhost/joehill_ndb_crm';

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #8 on: January 18, 2012, 07:30:02 am »
And you have a line like:

Code: [Select]
$db_prefix = '';
?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #9 on: January 18, 2012, 07:34:12 am »
yep:

$db_prefix = '';

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #10 on: January 18, 2012, 07:35:03 am »
Also possibly related, users are reporting that when they change their passwords from the ones they were given they are unable to log in with the new password

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #11 on: January 18, 2012, 07:40:24 am »
Sounds related. Do you have any multi-site modules like Domain or Domain Access?

I am wondering if either your site uses a different users table or if some other site is also accessing your users table.

But anyhow if users can't update passwords successfully, then it sounds like you have a basic Drupal problem, not necessarily related to CiviCRM. If you can fix that, then probably CiviCRM will work fine.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #12 on: January 18, 2012, 07:46:39 am »
Do you have any multi-site modules like Domain or Domain Access?
Nope

But anyhow if users can't update passwords successfully, then it sounds like you have a basic Drupal problem, not necessarily related to CiviCRM. If you can fix that, then probably CiviCRM will work fine.
Will try disabling the CiviCRM modules and seeing if the problem persists

Offline snowball

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #13 on: January 19, 2012, 09:48:20 am »
Ok, I seem to have fixed the issue, the problem was I had ported this data from a different Drupal install, truncating civicrm_uf_match solved the issue

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3581
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Problem with drupal accounts linking to civicrm contacts
« Reply #14 on: January 19, 2012, 10:17:14 am »
...the problem was I had ported this data from a different Drupal install

Aha. That explains it.

Thanks for following up.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007