Migration: canonicalize pre-existing lowercase locale rows after #1551
#1781
khoinguyenpham04
announced in
Roadmap
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This Roadmap discussion mirrors #1599: Migration: canonicalize pre-existing lowercase
localerows after #1551.Use this discussion to upvote the roadmap item and discuss priority, use cases, and product feedback. Keep implementation tracking, reproduction details, and PR-specific feedback on the source issue.
Original Issue
Summary
Follow-up from #1572 (review on #1551). That PR makes the API
?locale=filter preserve BCP-47 casing and applieslocaleCodevalidation to the shared taxonomy/menu locale filter. It deliberately does not touch rows that were already written with a lowercasedlocalebefore the fix.emdashbot's review suggested a forward-only data migration to canonicalize any pre-existing lowercase
localevalues in theec_*tables against the configured locale set. That was scoped out of #1572 to keep the fix focused; this issue tracks it.Problem
Before #1551, the API schema lowercased the
?locale=filter value. For locales whose canonical BCP-47 form has an uppercase region/script subtag (e.g.zh-TW,pt-BR,zh-Hant), content created through the API could have been persisted with a lowercasedlocalecolumn value (zh-tw,pt-br,zh-hant) that no longer matchesgetI18nConfig().localesor the casing-preserving query path. After #1551 those stale rows will be filtered out, because the query now compares against the verbatim-cased locale.Proposed fix
A forward-only migration that, for each
ec_*table carrying alocalecolumn, rewrites any storedlocaleto its canonical form when a case-insensitive match exists ingetI18nConfig().locales. Rows whoselocalehas no case-insensitive match in the configured set should be left untouched (and ideally surfaced, not silently rewritten).Notes / open questions
localematches no configured locale at all (orphaned/removed locale): leave as-is vs. log a warning.ec_*tables that carry alocalecolumn.Tracked as the deferred item from #1572.
Beta Was this translation helpful? Give feedback.
All reactions