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) »
  • CiviEngage installation error
Pages: [1]

Author Topic: CiviEngage installation error  (Read 1156 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
CiviEngage installation error
August 03, 2010, 01:16:07 pm
When on step 4 of http://wiki.civicrm.org/confluence/display/CRMDOC32/CiviEngage+Installation

I get the following error:

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

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_option_value_en_US (label , value , is_default , weight , is_optgroup , is_reserved , is_active ) VALUES ('Democrat' , 'Democrat' ,  0 ,  1 ,  0 ,  0 ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nbndp_civ`.`civicrm_option_value`, CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_option_value_en_US (label , value , is_default , weight , is_optgroup , is_reserved , is_active ) VALUES ('Democrat' , 'Democrat' ,  0 ,  1 ,  0 ,  0 ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nbndp_civ`.`civicrm_option_value`, CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_option_value_en_US (label , value , is_default , weight , is_optgroup , is_reserved , is_active ) VALUES ('Democrat' , 'Democrat' ,  0 ,  1 ,  0 ,  0 ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`nbndp_civ`.`civicrm_option_value`, CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE)]"]
)

Seems like there is a missing option_group_id that may not have been provided because is_optgroup is false.

Should I file an issue?
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Re: CiviEngage installation error
August 03, 2010, 07:35:28 pm
hey folks,

i tried to upgrade my civicrm 3.1 site using CiviEngage and the upgrade succeeded but the Demographics custom group that CiviEngage creates, which is supposed to be injected into the contact summary screen, is not being injected. i do not know why it is not working. but since i saw that the regular install was having problems i thought i would try to install it from scratch.

i got the same error described above. my investigation shows that what CiviEngage is trying to do when it fails is create fields in civicrm_uf_field associated with the row in civicrm_uf_group titled "TEMP update const grass info." this is what happens in the 3.1 version of CiviEngage.

the CiviEngage install is not able to create this group and therefore cannot create any fields associated with it.

i don't know enough about how CiviEngage works on the back end to take it any further.

as for the upgrading, it seems like 3.2 already injects the default demographic data into the summary page (including a new field called "preferred language." CiviEngage has two language fields that it creates, primary language and secondary language. it seems we need to figure out how to replace primary language with preferred language for starters.

please let me know how i can help get this working again...

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviEngage installation error
August 04, 2010, 08:32:45 am
There are several issues that I'm attempting to untangle.

The xml file uses labels rather than names to refer to option groups and custom groups. The import.php script doesn't do lookups on the lables to get the name, causing the errors we've experienced.

In the absence of dlobo or dgg on irc to tell me about architecture, I thought maybe the issue was that there had been a mistake in the choice of fields for the xml. Checking my database's name against those the in file indicated no discrepancy. Go ahead with replacing labels with names repeatedly throughout the document worked very well to resolve things.

Until, that is, we got to custom fields. In this case I had created some before importing civiengage's data. As there is a 'special' naming convention that for convenience I assume appends the id to the name of custom fields, it was not possible to deal with the conflict between the name in the xml file for Name_1 and mine, as custom field 1 was used for something else on my installation.

I think that the idea in using labels is to assume that they are unique as there is a unique index on it as well as on the primary key id field. So during import if there is no name field, then do a retrieve to get it using the label as a parameter. I'm going to work on that now.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviEngage installation error
August 04, 2010, 10:50:54 am
See http://issues.civicrm.org/jira/browse/CRM-6590.

More to come.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: CiviEngage installation error
August 04, 2010, 10:59:36 am
To add the unique key on an existing civicrm install, execute the following query:

alter table civicrm_uf_group add constraint unique index Code_name (name);
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

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: CiviEngage installation error
August 05, 2010, 03:30:28 pm

1. i installed this on a clean version of 3.2.0 and the install worked fine. There was a bug in import.php which is now fixed in svn

2. civicrm_engage will be moved to drupal/modules in 3.2.1

3. the migrate script specifically ignores ids (since they cannot be relied to be the same)

4. For civicrm_engage, for 3.2 i'd recommend we keep the primary and secondary language fields as is. When we roll in the campaign changes (maybe in 3.3/4.), we should figure out what to do

5. Josue, not sure why the demographic stuff does not work for you. It worked for me nicely in my 3.2 install, ping us on IRC and we can figure it out

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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • CiviEngage installation error

This forum was archived on 2017-11-26.