Bonjour,
Je suis loin d'être un spécialiste de galette, mais ... La définition de
table galette_adhérents stipule que la valeur par défaut pour le champ
id_statut est '4' :
CREATE TABLE `galette_adherents` (
`id_adh` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_statut` int(10) unsigned NOT NULL DEFAULT '4',
[ ...]
KEY `id_statut` (`id_statut`),
KEY `titre_adh` (`titre_adh`),
CONSTRAINT `galette_adherents_ibfk_1` FOREIGN KEY (`id_statut`)
REFERENCES `galette_statuts` (`id_statut`),
CONSTRAINT `galette_adherents_ibfk_2` FOREIGN KEY (`titre_adh`)
REFERENCES `galette_titles` (`id_title`)
) ENGINE=InnoDB AUTO_INCREMENT=629 DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
Donc en modifiant le csv sans y intégrer le champ id_statut, cela
donnerait :
INSERT INTO `galette_adherents` ( `nom_adh`, `prenom_adh`, `pseudo_adh`,
`societe_adh`, `titre_adh`, `ddn_adh`, `sexe_adh`, `adresse_adh`,
`adresse2_adh`, `cp_adh`, `ville_adh`, `pays_adh`, `tel_adh`, `gsm_adh`,
`email_adh`, `url_adh`, `icq_adh`, `msn_adh`, `jabber_adh`, `info_adh`,
`info_public_adh`, `prof_adh`, `login_adh`, `mdp_adh`, `date_crea_adh`,
`date_modif_adh`, `activite_adh`, `bool_admin_adh`, `bool_exempt_adh`,
`bool_display_info`, `date_echeance`, `pref_lang`, `lieu_naissance`,
`gpgid`, `fingerprint`, `parent_id`) VALUES ('TOTO', 'Franc', '',
'ASSOC1', '1', NULL, '1', '100 grand rue', 'Bat B', '85000', 'LA ROCHE
SUR YON', '', '', '', 't...@gmail.com <mailto:t...@gmail.com>', '', '',
'', '', '', '', 'jabber', '85000', '', '2016-01-31', '2016-01-31', '1',
'0', '0', '0', NULL, 'fr_FR', '', '', '', NULL)
ou le champ id_statut n'est pas spécifié, et devrait donc prendre sa
valeur par défaut, cela marchera si la table galette_statuts contient
une entrée avec id_statut à 4 ("membre actif").
J'espère avoir été clair.
Bruno
Le 31/01/2016 23:09, Pierre ROGER a écrit :
Bonsoir
Lors de l'import de mes adhérents, le galop d'essai marche mais pas
l'importation.
J'ai fait un essai avec un seul enregistrement et ça donne ça :
Dans le fichier log :
178.33.103.145 - 2016-01-31 22:05:22 - 5 - PHP Notice: Undefined
variable: this in
/home/unapeda/www/Galette/lib/Galette/IO/FileTrait.php on line 428
178.33.103.145 - 2016-01-31 22:05:27 - 5 - PHP Notice: Undefined
variable: members_fields_cats in
/home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php on line 216
178.33.103.145 - 2016-01-31 22:05:34 - 5 - PHP Notice: Undefined
variable: members_fields_cats in
/home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php on line 216
178.33.103.145 - 2016-01-31 22:05:34 - 3 - Query error: INSERT INTO
`galette_adherents` (`id_statut`, `nom_adh`, `prenom_adh`,
`pseudo_adh`, `societe_adh`, `titre_adh`, `ddn_adh`, `sexe_adh`,
`adresse_adh`, `adresse2_adh`, `cp_adh`, `ville_adh`, `pays_adh`,
`tel_adh`, `gsm_adh`, `email_adh`, `url_adh`, `icq_adh`, `msn_adh`,
`jabber_adh`, `info_adh`, `info_public_adh`, `prof_adh`, `login_adh`,
`mdp_adh`, `date_crea_adh`, `date_modif_adh`, `activite_adh`,
`bool_admin_adh`, `bool_exempt_adh`, `bool_display_info`,
`date_echeance`, `pref_lang`, `lieu_naissance`, `gpgid`,
`fingerprint`, `parent_id`) VALUES ('', 'TOTO', 'Franc', '', 'ASSOC1',
'1', NULL, '1', '100 grand rue', 'Bat B', '85000', 'LA ROCHE SUR YON',
'', '', '', 't...@gmail.com <mailto:t...@gmail.com>', '', '', '', '',
'', '', 'jabber', '85000', '', '2016-01-31', '2016-01-31', '1', '0',
'0', '0', NULL, 'fr_FR', '', '', '', NULL) exception 'PDOException'
with message 'SQLSTATE[23000]: Integrity constraint violation: 1452
Cannot add or update a child row: a foreign key constraint fails
(`unapedaassoc`.`galette_adherents`, CONSTRAINT
`galette_adherents_ibfk_1` FOREIGN KEY (`id_statut`) REFERENCES
`galette_statuts` (`id_statut`))' in
/home/unapeda/www/Galette/includes/Zend-2.3.7/Zend/Db/Adapter/Driver/Pdo/Connection.php:438
Stack trace:
#0
/home/unapeda/www/Galette/includes/Zend-2.3.7/Zend/Db/Adapter/Driver/Pdo/Connection.php(438):
PDO->query('INSERT INTO `ga...')
#1
/home/unapeda/www/Galette/includes/Zend-2.3.7/Zend/Db/Adapter/Adapter.php(190):
Zend\Db\Adapter\Driver\Pdo\Connection->execute('INSERT INTO `ga...')
#2 /home/unapeda/www/Galette/lib/Galette/Core/Db.php(731):
Zend\Db\Adapter\Adapter->query('INSERT INTO `ga...', 'execute')
#3 /home/unapeda/www/Galette/lib/Galette/Entity/Adherent.php(1262):
Galette\Core\Db->execute(Object(Zend\Db\Sql\Insert))
#4 /home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php(325):
Galette\Entity\Adherent->store()
#5 /home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php(173):
Galette\IO\CsvIn->_storeMembers('galette_import_...')
#6 /home/unapeda/www/Galette/import.php(107):
Galette\IO\CsvIn->import('galette_import_...', Array, false)
#7 {main}
178.33.103.145 - 2016-01-31 22:05:34 - 3 - Something went wrong :'( |
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
update a child row: a foreign key constraint fails
(`unapedaassoc`.`galette_adherents`, CONSTRAINT
`galette_adherents_ibfk_1` FOREIGN KEY (`id_statut`) REFERENCES
`galette_statuts` (`id_statut`))
#0
/home/unapeda/www/Galette/includes/Zend-2.3.7/Zend/Db/Adapter/Driver/Pdo/Connection.php(438):
PDO->query('INSERT INTO `ga...')
#1
/home/unapeda/www/Galette/includes/Zend-2.3.7/Zend/Db/Adapter/Adapter.php(190):
Zend\Db\Adapter\Driver\Pdo\Connection->execute('INSERT INTO `ga...')
#2 /home/unapeda/www/Galette/lib/Galette/Core/Db.php(731):
Zend\Db\Adapter\Adapter->query('INSERT INTO `ga...', 'execute')
#3 /home/unapeda/www/Galette/lib/Galette/Entity/Adherent.php(1262):
Galette\Core\Db->execute(Object(Zend\Db\Sql\Insert))
#4 /home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php(325):
Galette\Entity\Adherent->store()
#5 /home/unapeda/www/Galette/lib/Galette/IO/CsvIn.php(173):
Galette\IO\CsvIn->_storeMembers('galette_import_...')
#6 /home/unapeda/www/Galette/import.php(107):
Galette\IO\CsvIn->import('galette_import_...', Array, false)
#7 {main}
178.33.103.145 - 2016-01-31 22:05:34 - 3 - [Galette\IO\CsvIn] Une
erreur est survenue lors de l'enregistrement de l'adhérent ligne 1
(TOTO Franc) :
Merci de votre aide
RP
_______________________________________________
Galette-discussion mailing list
Galette-discussion@gna.org
https://mail.gna.org/listinfo/galette-discussion
_______________________________________________
Galette-discussion mailing list
Galette-discussion@gna.org
https://mail.gna.org/listinfo/galette-discussion