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 Drupal Modules (Moderator: Donald Lobo) »
  • prefix causes error when registering user.
Pages: [1]

Author Topic: prefix causes error when registering user.  (Read 1301 times)

bendev

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
prefix causes error when registering user.
September 01, 2011, 10:41:44 am
Hello,

I get the following error when registering a new user. It seems related to the fact that I use a prefix for the drupal db.

PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'drupal_users.uid' in 'field list': SELECT drupal_users.uid AS uid FROM {users} users WHERE (name LIKE :db_condition_placeholder_0 ESCAPE '\\') LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => testben ) dans CRM_Core_BAO_CMSUser::checkUserNameEmailExists() (ligne 369 dans /***/sites/all/modules/civicrm/CRM/Core/BAO/CMSUser.php).
..

Same error as in this topic ? http://forum.civicrm.org/index.php?topic=20201.0

How can I correct it temporary?
Will it be fixed ?


PS: I am using the module login toboggan. It seems the username verification is onlydone when this module is used.

bendev

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: prefix causes error when registering user.
September 04, 2011, 11:25:13 am
here is the answer  (thanks to Lucio)

Open the file sites/all/modules/civicrm/CRM/Core/BAO/CMSUser.php

On line 369 and 377 you've got this code snippet:

Code: [Select]
db_select('users')->fields($config->userFrameworkUsersTableName, array('uid'))

change it to this one:

Code: [Select]
db_select('users')->fields('users', array('uid'))

(Replacing $config->userFrameworkUsersTableName with 'users')

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: prefix causes error when registering user.
September 05, 2011, 09:25:15 am

can you please file an issue: http://issues.civicrm.org/ and attach the patch there

thanx

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • prefix causes error when registering user.

This forum was archived on 2017-11-26.