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 Import (Moderator: Yashodha Chaku) »
  • Error running import script for Gift Aid Module -RESOLVED-
Pages: [1]

Author Topic: Error running import script for Gift Aid Module -RESOLVED-  (Read 1004 times)

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Error running import script for Gift Aid Module -RESOLVED-
March 28, 2011, 01:53:02 am
Hi Everyone

I am trying to run the import of all the custom fields and profiles that come with the giftaid module for CiviCRM and i have got an error message that im not sure how to solve. It only seems to have a problem pulling over the Cusatom Profile, not the individual fields. All of the custom fields imported perfectly but if fails on the custom profile with this error:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_field (field_name , is_active , is_view , is_required , weight , help_post , visibility , in_selector , is_searchable , label , field_type ) VALUES ('custom_7' ,  1 ,  0 ,  1 ,  1 , '<p>By selecting \'Yes\' above you are confirming that\n<ol>\n<li>you are a UK taxpayer and</li>\n<li>the amount of income and/or capital gains tax you pay is at least as much as we will reclaim on your donations in this tax year.</li>\n</ol>\n<p><b>About Gift Aid</b><p>\n<p>Gift Aid increases the value of donations to charities by allowing them to reclaim basic rate tax on your gift.  We would like to reclaim gift aid on your behalf.  We can only reclaim Gift Aid if you are a UK taxpayer.  Please confirm that you are a eligible for gift aid above.  <a href=\"http://www.hmrc.gov.uk/individuals/giving/gift-aid.htm\">More about Gift Aid</a>.</p>' , 'User and User Admin Only' ,  0 ,  0 , 'Can we reclaim gift aid on your donation?' , 'Contribution' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_uf_field`, CONSTRAINT `FK_civicrm_uf_field_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_field (field_name , is_active , is_view , is_required , weight , help_post , visibility , in_selector , is_searchable , label , field_type ) VALUES ('custom_7' ,  1 ,  0 ,  1 ,  1 , '<p>By selecting \'Yes\' above you are confirming that\n<ol>\n<li>you are a UK taxpayer and</li>\n<li>the amount of income and/or capital gains tax you pay is at least as much as we will reclaim on your donations in this tax year.</li>\n</ol>\n<p><b>About Gift Aid</b><p>\n<p>Gift Aid increases the value of donations to charities by allowing them to reclaim basic rate tax on your gift.  We would like to reclaim gift aid on your behalf.  We can only reclaim Gift Aid if you are a UK taxpayer.  Please confirm that you are a eligible for gift aid above.  <a href=\"http://www.hmrc.gov.uk/individuals/giving/gift-aid.htm\">More about Gift Aid</a>.</p>' , 'User and User Admin Only' ,  0 ,  0 , 'Can we reclaim gift aid on your donation?' , 'Contribution' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_uf_field`, CONSTRAINT `FK_civicrm_uf_field_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_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_uf_field (field_name , is_active , is_view , is_required , weight , help_post , visibility , in_selector , is_searchable , label , field_type ) VALUES ('custom_7' ,  1 ,  0 ,  1 ,  1 , '<p>By selecting \'Yes\' above you are confirming that\n<ol>\n<li>you are a UK taxpayer and</li>\n<li>the amount of income and/or capital gains tax you pay is at least as much as we will reclaim on your donations in this tax year.</li>\n</ol>\n<p><b>About Gift Aid</b><p>\n<p>Gift Aid increases the value of donations to charities by allowing them to reclaim basic rate tax on your gift.  We would like to reclaim gift aid on your behalf.  We can only reclaim Gift Aid if you are a UK taxpayer.  Please confirm that you are a eligible for gift aid above.  <a href=\"http://www.hmrc.gov.uk/individuals/giving/gift-aid.htm\">More about Gift Aid</a>.</p>' , 'User and User Admin Only' ,  0 ,  0 , 'Can we reclaim gift aid on your donation?' , 'Contribution' )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_uf_field`, CONSTRAINT `FK_civicrm_uf_field_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`) ON DELETE CASCADE)]"]
)


Ideas anyone?

Chelcone
« Last Edit: March 31, 2011, 04:38:05 am by Chelcone »

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: Error running import script for Gift Aid Module
March 28, 2011, 06:29:19 am

can u apply this patch:

Code: [Select]
bash-3.2$ svn diff -r PREV bin/migrate/import.php
Index: bin/migrate/import.php
===================================================================
--- bin/migrate/import.php      (revision 32050)
+++ bin/migrate/import.php      (working copy)
@@ -314,7 +314,7 @@
                 $profileGroup = new CRM_Core_DAO_UFGroup( );
                 $this->copyData( $profileGroup, $profileGroupXML, true, 'title' );
                 $idMap['profile_group'][$profileGroup->name] = $profileGroup->id;
-                $idMap['profile_group'][$profileGroup->name]  = $profileGroup->id;
+                $idMap['profile_group'][$profileGroup->title]  = $profileGroup->id;
             }
         }
     }

what version are u on?

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

Chelcone

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 1
  • CiviCRM version: 3.4.0
  • CMS version: Drupal 6.*
  • MySQL version: MySQL 5.*
Re: Error running import script for Gift Aid Module
March 31, 2011, 03:28:45 am
I must have made a mistake on the install because i reinstalled and it worked fine. Human error!

Thanks anyway

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Error running import script for Gift Aid Module -RESOLVED-

This forum was archived on 2017-11-26.