fix: l'import CSV compare noms et unités sans tenir compte des accents, comme la base #178
No reviewers
Labels
No labels
auto-merge
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AcadeNice/corentin_wakdo!178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/import-accent-insensitive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Trouvé par le comparatif attendu / réel du 2026-09-27 : le test navigateur officiel
tests/e2e/admin-product-recipe-import.spec.jsétait rouge sur la version déployée (11271f7).Le défaut
Télécharger le modèle CSV puis le réimporter sans y toucher bloquait l'import : « Unité "piece" différente de l'unité existante ("pièce") pour l'ingrédient "Pain burger" » (et « Steak hache »).
Cause : depuis la migration 0016 (#166), les données de démonstration portent leurs accents (« pièce », « Steak haché »). La base retrouve bien l'ingrédient, car sa collation
utf8mb4_unicode_ciignore les accents ; mais la comparaison d'unité, faite en PHP parnormalize(), en tenait compte.La correction
ProductImportService::normalize()ignore désormais la casse et les accents (Normalizerde l'extension intl, présente dans l'image de production), comme la base. Ce changement vaut pour toutes les comparaisons de l'import : unités, regroupement des ingrédients, détection des doublons.php-intl, comme l'image de production ; sans lui,Normalizern'existe pas sur le PHP de Debian.Preuves
php-intl, comme la CI : OK, 66 tests.The downloaded template ("piece", "Steak hache") re-imported unchanged was blocked against the demo data since migration 0016 added accents ("pièce", "Steak haché"): the database matched the ingredient accent-insensitively (utf8mb4_unicode_ci) but the PHP unit check did not. normalize() now folds diacritics (intl Normalizer, present in the production image), the template uses the real spellings, and CI installs php-intl like production. Found by the 2026-09-27 expected-vs-actual audit (official e2e spec admin-product-recipe-import was red on11271f7).