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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • DB error on creating contact reference field in multilang install
Pages: [1]

Author Topic: DB error on creating contact reference field in multilang install  (Read 997 times)

cray146

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.3
DB error on creating contact reference field in multilang install
October 28, 2010, 12:11:34 pm
Hi,

I'm running CiviCRM 3.2.3 on drupal.  I have multilang enabled to support both dutch and french. I've created a subtype, Student, based on contact type Individual, to capture additional information of students doing their internship. So far, so good. Now I want to use a custom contact reference field to relate the student to the internship mentor. I get DB error 1005 (errno 105) (http://dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html)

Additional info:

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

    [code_] => -15
    [message] => DB Error: can not create
    [mode] => 16
    [debug_info] =>         ALTER TABLE civicrm_value_student_info_2
        ADD COLUMN `gp_in_training_mentor_9` int unsigned,
        ADD INDEX INDEX_gp_in_training_mentor_9 ( gp_in_training_mentor_9 ),
        ADD CONSTRAINT FK_civicrm_value_student_info_2_gp__c12fa2c18aeb243c FOREIGN KEY ( `gp_in_training_mentor_9` ) REFERENCES civicrm_contact_nl_NL ( id ) ON DELETE SET NULL [nativecode=1005 ** Can't create table './civicrm/#sql-12e7_2bc00.frm' (errno: 150)]
    [type] => DB_Error
    [user_info] =>         ALTER TABLE civicrm_value_student_info_2
        ADD COLUMN `gp_in_training_mentor_9` int unsigned,
        ADD INDEX INDEX_gp_in_training_mentor_9 ( gp_in_training_mentor_9 ),
        ADD CONSTRAINT FK_civicrm_value_student_info_2_gp__c12fa2c18aeb243c FOREIGN KEY ( `gp_in_training_mentor_9` ) REFERENCES civicrm_contact_nl_NL ( id ) ON DELETE SET NULL [nativecode=1005 ** Can't create table './civicrm/#sql-12e7_2bc00.frm' (errno: 150)]
    [to_string] => [db_error: message="DB Error: can not create" code=-15 mode=callback callback=CRM_Core_Error::handle prefix="" info="        ALTER TABLE civicrm_value_student_info_2
        ADD COLUMN `gp_in_training_mentor_9` int unsigned,
        ADD INDEX INDEX_gp_in_training_mentor_9 ( gp_in_training_mentor_9 ),
        ADD CONSTRAINT FK_civicrm_value_student_info_2_gp__c12fa2c18aeb243c FOREIGN KEY ( `gp_in_training_mentor_9` ) REFERENCES civicrm_contact_nl_NL ( id ) ON DELETE SET NULL [nativecode=1005 ** Can't create table './civicrm/#sql-12e7_2bc00.frm' (errno: 150)]"]
)

There goes something wrong when the foreign key is added. It probably has something to do with the multilang install since the foreign key references a view that is specific to multilang. Any idea on how this problem can be solved?

Thanks,

c.
« Last Edit: October 29, 2010, 01:47:08 am by cray146 »

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: DB error on creating contact reference field in multilang install
October 29, 2010, 05:41:12 am
Argh, custom contact reference field creation should short-circuit query rewrite. Thanks a lot for catching this, CRM-7007 filed.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: DB error on creating contact reference field in multilang install
November 02, 2010, 10:01:29 am
Thanks a lot for reporting this; the issue should be fixed by r30489, which will be a part of CiviCRM 3.2.5.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

cray146

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.3
Re: DB error on creating contact reference field in multilang install
November 05, 2010, 03:52:05 am
Great! Thanks for the quick response.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • DB error on creating contact reference field in multilang install

This forum was archived on 2017-11-26.