Import CSV: une ligne vide génère une erreur
Etapes pour reproduire le bug
- Avec Vagrant D&N, installer le build du job 35638. (Dans le dépôt, Commit SHA1 e5cc2c8d86ccd645ae83dff5861900e0b21c4ab2)
mkdir /var/www/notaires/imports/
touch /var/www/notaires/imports/fichier.csv
- Copier/coller dans
/var/www/notaires/imports/fichier.csv
le contenu de Documentation/Sources/donnees_test.csv - Lancer
bin/console import:individus "imports/fichier.csv"
Quel est le comportement actuel du bug
L'import se termine avec l'erreur Individu # | DateTime::__construct(): Failed to parse time string (--) at position 0 (-): Unexpected character
Quel est le comportement correct
L'import devrait se terminer sans erreur
Fichiers journaux ou copies d'écrans
Début import
Path : /var/www/notaires/src/Command/../../imports/fichier.csv
Fichier trouvé
6 individus à importer
Purge des individus précédents
Fin purge des individus précédents
Vérification de l'entête
Fin vérification de l'entête
1/6 [====🍺-----------------------] 16%11:37:14 WARNING [php] Notice: Undefined offset: 1 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 2 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 3 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 4 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 5 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 6 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 7 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 8 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 9 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 10 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 11 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 12 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 13 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 2 ["exception" => ErrorException { …}]
11:37:14 WARNING [php] Notice: Undefined offset: 1 ["exception" => ErrorException { …}]
6/6 [============================] 100%
+------------+---------------------------------------------------------------------------------------------------+
| Individu # | DateTime::__construct(): Failed to parse time string (--) at position 0 (-): Unexpected character |
+------------+---------------------------------------------------------------------------------------------------+
Fin import
Pistes de solution
- Erreur de date dans le fichier CSV ? (919 au lieu de 1919)
/cc @mfaure