Skip to content

fix: derive card.variation from the reference instead of a locale-gat… - #74

Merged
toxicity1985 merged 1 commit into
mainfrom
fix/card-variation-from-reference
Sep 14, 2026
Merged

toxicity1985 merged 1 commit into
mainfrom
fix/card-variation-from-reference

Conversation

@julesduroux

@julesduroux julesduroux commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Le bug

CardBuilder::applyPrintingIdentity() mettait toujours variation à "standard"
par défaut, et ne positionnait "promo" que depuis applyFrFrFields() — donc
uniquement pour la locale fr-fr, via un test fragile sur la position 4 de
collectorNumberFormatted. "alt-art" n'était produit par aucun chemin de
code, alors que le docblock de l'entité le liste comme valeur valide.

Le fix

La référence encode déjà de façon fiable la vraie variante d'impression dans
son 3e segment (ALT_SET_VARIANT_FACTION_NUM_RARITY — B/P/A) — le même
segment que CardGroupBuilder::buildSlug() lit déjà pour ses propres besoins.
variation est maintenant dérivé de là, indépendamment de la locale et de
l'ordre d'import. kickstarter/serialized restent prioritaires comme avant
(ce sont des flags dédiés, orthogonaux à B/P/A).

Une migration de backfill (Version20260911160000) corrige les cartes déjà en
base, sans toucher aux cartes kickstarter/serialized.

À exécuter après merge

la migration tourne automatiquement au prochain déploiement (doctrine:migrations:migrate, déjà dans le pipeline existant).
mais il faut lancer php bin/console app:meilisearch:index --fields=variation pour
resynchroniser l'index de recherche (la migration écrit en SQL brut, donc les
listeners Doctrine qui maintiennent Meilisearch ne se déclenchent pas).

…ed heuristic

CardBuilder::applyPrintingIdentity() always defaulted variation to
"standard" and only ever set "promo" from inside applyFrFrFields()
(fr-fr locale only, via a fragile collectorNumberFormatted-position
check) - "alt-art" was never produced by any code path at all, even
though the entity's own docblock lists it as a valid value.

The reference already encodes the true printing variant reliably in
its 3rd segment (ALT_SET_VARIANT_FACTION_NUM_RARITY - B/P/A), the
same segment CardGroupBuilder::buildSlug() already reads for its own
purposes. Derive variation from there instead, independent of locale
and import order. kickstarter/serialized stay as dedicated flags,
taking precedence exactly as before.

Includes a backfill migration for cards already in the database.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@toxicity1985
toxicity1985 merged commit 1c194d6 into main Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants