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) »
  • Language and Locality »
  • Francophone User Group (Moderators: mathieu, xavier) »
  • Problème importation contact
Pages: [1]

Author Topic: Problème importation contact  (Read 887 times)

natinho

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: CiviCRM 4.4.5.
  • CMS version: Wordpress 3.9.1
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP5
Problème importation contact
June 18, 2014, 07:37:50 am
Bonjour à tous,

J'ai installé CiviCRM pour l'association dans laquelle je travaille.

Ce CRM à l'air très puissant et peut faire énormement de choses, même si je n'ai pas encore compris toutes les fonctionnalités.

J'ai cependant un problème. Etant débutant je me tourne vers vous pour m'aider.

Je ne peux pas importer une liste de contact (750 contacts) et c'est très gênant car à la main c'est hyper long.

J'ai trouvé comment activer le debug et je vous retourne le résultat de celui-ci.

Je sais que ce sujet à peut etre déjà été traité par nos confrères utilisateur anglophones, mais je ne suis pas très doué avec la langue de Shakespeare...

Voici le debug :

Code: [Select]
backTrace

#0 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(149): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: constraint violation", -3, 16, (Array:2), "INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...")
#4 /var/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-3, 16, (Array:2), "INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...")
#5 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -3, NULL, NULL, "INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...", "DB_Error", TRUE)
#6 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-3, NULL, NULL, NULL, "1452 ** Cannot add or update a child row: a foreign key constraint fails (`ci...")
#7 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...")
#9 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...")
#10 /var/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1055): DB_DataObject->_query("INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_...")
#11 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(278): DB_DataObject->insert()
#12 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Address.php(162): CRM_Core_DAO->save()
#13 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Address.php(126): CRM_Core_BAO_Address::add((Array:7), TRUE)
#14 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/Location.php(69): CRM_Core_BAO_Address::create((Array:20), TRUE, NULL)
#15 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(352): CRM_Core_BAO_Location::create((Array:20), TRUE)
#16 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(1775): CRM_Contact_BAO_Contact::create((Array:20))
#17 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser/Contact.php(1672): CRM_Contact_BAO_Contact::createProfileContact((Array:7), (Array:34), NULL, NULL, NULL, "Individual")
#18 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser/Contact.php(680): CRM_Contact_Import_Parser_Contact->createContact((Array:7), (Array:34), "1", NULL, TRUE, "")
#19 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Parser.php(208): CRM_Contact_Import_Parser_Contact->import("1", (Array:11), NULL)
#20 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/ImportJob.php(276): CRM_Contact_Import_Parser->run("civicrm_import_job_5cc2d02412d8a245140be9de3b68b128", (Array:8), 8, 1, "_id", "_status", "1", "70a4ed26920f64531656cc89f6582b8d", 8, NULL, 30, NULL, "")
#21 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Contact/Import/Form/Preview.php(282): CRM_Contact_Import_ImportJob->runImport(Object(CRM_Contact_Import_Form_Preview))
#22 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(261): CRM_Contact_Import_Form_Preview->postProcess()
#23 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#24 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(60): CRM_Core_StateMachine->perform(Object(CRM_Contact_Import_Form_Preview), "next", "Next")
#25 /var/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Import_Form_Preview), "next")
#26 /var/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Import_Form_Preview), "next")
#27 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(339): HTML_QuickForm_Page->handle("next")
#28 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(323): CRM_Core_Controller->run((Array:3), NULL)
#29 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(72): CRM_Core_Invoke::runItem((Array:13))
#30 /var/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#31 /var/www/wp-content/plugins/civicrm/civicrm.php(470): CRM_Core_Invoke::invoke((Array:3))
#32 [internal function](): CiviCRM_For_WordPress->invoke("")
#33 /var/www/wp-includes/plugin.php(470): call_user_func_array((Array:2), (Array:1))
#34 /var/www/wp-admin/admin.php(211): do_action("toplevel_page_CiviCRM")
#35 {main}

Et voici la notice :

Code: [Select]
Code d'erreur de la base de données : Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL), 1452
Détails additionnels :
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , manual_geo_code , master_id ) VALUES ( 74 ,  2 ,  1 ,  0 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , manual_geo_code , master_id ) VALUES ( 74 ,  2 ,  1 ,  0 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_address (contact_id , location_type_id , is_primary , is_billing , manual_geo_code , master_id ) VALUES ( 74 ,  2 ,  1 ,  0 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_address`, CONSTRAINT `FK_civicrm_address_master_id` FOREIGN KEY (`master_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL)]"]
)


Est ce que quelqu'un peut m'éclairer et me donner la marche à suivre pour pouvoir importer des contacts.

Merci énormément !

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Problème importation contact
June 18, 2014, 01:47:27 pm
hi - from the land of new zealand - but we understand shakespearean - and apparently i can read French well enough to understand your post ;-)

i suggest you put this through google translate rather than have me write bad French.

Please retest your import with just a small sample of the csv.

And if that fails, can you please upload an anonymised copy of that here, as well as a screenshot of the Step 2 in the Import Wizard showing your field mapping.

hope you can decipher the above
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

natinho

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: CiviCRM 4.4.5.
  • CMS version: Wordpress 3.9.1
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP5
Re: Problème importation contact
June 19, 2014, 01:03:46 am
Déjà merci pour votre réponse ami Néo-zélandais.

J'ai déjà essayé de mettre juste une partie de mon csv, ça ne change rien.

J'ai mis mon bout de csv en pièce jointe.

Voici un screenshot de l'étape 2 :

http://hpics.li/88535cd

Merci pour votre aide !


mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Problème importation contact
June 19, 2014, 09:00:14 am
Salut,

On dirait que l'assistant à l'importation ne valide pas plus qu'il faut, et laisse la base de données valider (avec les messages d'erreurs que l'on voit!), mais selon l'erreur, ce serait à cause du champ "Adresse principale appartient à", qui est en fait le "address_master_id", donc une référence à une autre adresse (je ne suis pas 100% sûr de ce que ça veut dire, mais c'est relié aux adresses partagées entre contacts).

Bref, il faut choisir le bon champ adresse. Ça peut varier selon la traduction, mais je pense que le champ que tu recherches s'appelle tout simplement "Rue".

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Language and Locality »
  • Francophone User Group (Moderators: mathieu, xavier) »
  • Problème importation contact

This forum was archived on 2017-11-26.