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) »
  • override/disable profile used by Drupal user registration?
Pages: [1]

Author Topic: override/disable profile used by Drupal user registration?  (Read 1079 times)

boulderfuzz

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19
  • MySQL version: unknown
  • PHP version: unknown
override/disable profile used by Drupal user registration?
January 08, 2014, 02:19:58 pm
My org uses Drupal 6, and we include a Civi profile called "Name & Address" on the Drupal user registration form.

I am writing a Drupal module which programatically creates users, but keep running into problems with CiviCRM denying me permission to do so.  For example, if I run some PHP code on my Drupal site to create a user, the user is successfully created but I get back the following error (note that I had to include an extra "\" in front of "code" so the below message would format correctly):

Code: [Select]
DB Error: insufficient permissions
Error Details
Additional Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [\code] => -26
    [message] => DB Error: insufficient permissions
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contact (contact_type , sort_name , display_name , preferred_language , hash ) VALUES ('Individual' , 'aaa@example.com' , 'aaa@example.com' , 'en_US' , '57b061fa4fc75df61ca2a5a2ea82a434' )  [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_contact']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact (contact_type , sort_name , display_name , preferred_language , hash ) VALUES ('Individual' , 'aaa@example.com' , 'aaa@example.com' , 'en_US' , '57b061fa4fc75df61ca2a5a2ea82a434' )  [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_contact']
    [to_string] => [db_error: message="DB Error: insufficient permissions" code=-26 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact (contact_type , sort_name , display_name , preferred_language , hash ) VALUES ('Individual' , 'aaa@example.com' , 'aaa@example.com' , 'en_US' , '57b061fa4fc75df61ca2a5a2ea82a434' )  [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_contact']"]
)

I thought the easiest solution would be to no longer include Name & Address on the Drupal user registration form. So I cruised on over to Administer Profiles and unchecked the "Drupal User Registration" checkbox for the profile's settings.  Attempting to save the profile settings change throws another error:
Code: [Select]
DB Error: insufficient permissions
Error Details
Database Error Code: TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_uf_group', 1142
Additional Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [\code] => -26
    [message] => DB Error: insufficient permissions
    [mode] => 16
    [debug_info] => UPDATE  civicrm_uf_group  SET is_active = 1 , title = 'Name & Address' , help_pre = NULL , help_post = NULL , limit_listings_group_id = NULL , post_URL = NULL , add_to_group_id = NULL , add_captcha = 0 , is_map = 0 , is_edit_link = 0 , is_uf_link = 0 , is_update_dupe = 0 , cancel_URL = NULL , is_cms_user = 2 , notify = NULL , is_proximity_search = 0   WHERE (  civicrm_uf_group.id = 1 )   [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_uf_group']
    [type] => DB_Error
    [user_info] => UPDATE  civicrm_uf_group  SET is_active = 1 , title = 'Name & Address' , help_pre = NULL , help_post = NULL , limit_listings_group_id = NULL , post_URL = NULL , add_to_group_id = NULL , add_captcha = 0 , is_map = 0 , is_edit_link = 0 , is_uf_link = 0 , is_update_dupe = 0 , cancel_URL = NULL , is_cms_user = 2 , notify = NULL , is_proximity_search = 0   WHERE (  civicrm_uf_group.id = 1 )   [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_uf_group']
    [to_string] => [db_error: message="DB Error: insufficient permissions" code=-26 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE  civicrm_uf_group  SET is_active = 1 , title = 'Name & Address' , help_pre = NULL , help_post = NULL , limit_listings_group_id = NULL , post_URL = NULL , add_to_group_id = NULL , add_captcha = 0 , is_map = 0 , is_edit_link = 0 , is_uf_link = 0 , is_update_dupe = 0 , cancel_URL = NULL , is_cms_user = 2 , notify = NULL , is_proximity_search = 0   WHERE (  civicrm_uf_group.id = 1 )   [nativecode=1142 ** TRIGGER command denied to user 'bma_drupal'@'localhost' for table 'civicrm_uf_group']"]
)

Any ideas on what's going wrong?  As a workaround, can I disable Name & Address in the SQL tables?

To repeat, the fundamental problem is that CiviCRM is not allowing me to create Drupal user accounts without also throwing errors.  I'd like to avoid the errors for a clean user creation process.  Advice appreciated!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: override/disable profile used by Drupal user registration?
January 08, 2014, 02:23:28 pm
I think the fundamental problem is that your sql user for the drupal db does not have privileges on the civicrm db. The easiest way to set this up correctly would be to have both databases be owned by the same sql user.
Try asking your question on the new CiviCRM help site.

boulderfuzz

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19
  • MySQL version: unknown
  • PHP version: unknown
Re: override/disable profile used by Drupal user registration?
March 14, 2014, 01:27:57 pm
You were quite correct, the problem was indeed that the sql user lacked proper permissions to write to the civicrm db. Specific to my case, I have both a dev and a live db. With help from my host, we discovered that CiviCRM stores the original database user somewhere in the actual database, so the dev copy was still being written to by the live database user. Once the live database user was given read/write access to the development database, the error was resolved.

Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • override/disable profile used by Drupal user registration?

This forum was archived on 2017-11-26.