Repository navigation
fix: derive card.variation from the reference instead of a locale-gat… - #74
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Le bug
CardBuilder::applyPrintingIdentity()mettait toujoursvariationà"standard"par défaut, et ne positionnait
"promo"que depuisapplyFrFrFields()— doncuniquement pour la locale
fr-fr, via un test fragile sur la position 4 decollectorNumberFormatted."alt-art"n'était produit par aucun chemin decode, 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êmesegment que
CardGroupBuilder::buildSlug()lit déjà pour ses propres besoins.variationest maintenant dérivé de là, indépendamment de la locale et del'ordre d'import.
kickstarter/serializedrestent prioritaires comme avant(ce sont des flags dédiés, orthogonaux à B/P/A).
Une migration de backfill (
Version20260911160000) corrige les cartes déjà enbase, 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=variationpourresynchroniser l'index de recherche (la migration écrit en SQL brut, donc les
listeners Doctrine qui maintiennent Meilisearch ne se déclenchent pas).