Patch Changes
-
#3360
6f83886Thanks @danielmlr! - Updates taxonomy definitions sohierarchicalandcollectionsbelong to the taxonomy instead of to each locale. Every locale reads the same values, and translations can no longer disagree about whether a taxonomy is hierarchical or which collections it applies to.labelandlabelSingularstay per locale.This changes behavior for multilingual sites:
PUT /_emdash/api/taxonomies/{name}and the MCPtaxonomy_updatetool changehierarchicalandcollectionsfor every locale, even whenlocaleis passed. Previously they changed only the addressed locale's definition.- Creating a definition for a name that already exists in another locale joins that taxonomy, with or without
translationOf, instead of starting a separate translation group. It takes the taxonomy'shierarchicalandcollections; a create that sends different values returnsVALIDATION_ERROR, where it previously stored them for the new locale only. Change them with an update instead. getTaxonomyTerms(),getTaxonomyDef()andgetTaxonomyDefs()return a taxonomy in every locale, including a locale without its own definition, which takes its label from the first locale on its fallback chain that has one, else the default locale, else the lowest locale code. Previously such a locale got no definition and an empty term list, so the built-in Categories and Tags widgets rendered empty on sites whose default locale had no definition.- Seed files may omit
hierarchicalandcollectionson a taxonomy entry whosetranslationOfpoints at an entry with the samename. Applying a seed followstranslationOfthrough entries with the samenameand takes them from the last one, whatever the translations carry and wherever the entries appear in the file. Validation warns when a translation declares values other than the ones it takes, or when two entries that declare them for one taxonomy disagree. The exportedSeedTaxonomytype marks both fields optional, so code that reads them from a seed must handleundefined.emdash export-seedwrites them only on the entry the translations point at. - Importing a WordPress export (WXR) into a locale assigns the terms of a taxonomy that is defined only in another locale. Previously the import skipped them and reported the taxonomy as missing.
The upgrade migration merges existing definitions of each taxonomy name into one. Where locales disagreed, the taxonomy becomes hierarchical if any locale's definition was, and applies to every collection any locale's definition listed, so no term tree flattens and no collection loses a taxonomy it showed in some locale. Definitions of one name that were in separate translation groups are joined into one group. Definitions of different names that shared a translation group, which older seed files and API versions could create, get one group per name.
What should I do?
If your site defines different
hierarchicalorcollectionsvalues per locale on purpose, check them after upgrading and set the values you want once.If your code changes
hierarchicalorcollectionsby writing to_emdash_taxonomy_defswith SQL, use the taxonomy API, the MCPtaxonomy_updatetool or a seed file instead. A direct write no longer changes what EmDash reads, only what sandboxed plugins see. EmDash still updates those columns whenever a taxonomy changes, for code that reads them.@emdash-cms/plugin-test:runtimeHost.fixtures.taxonomyDefinition()setshierarchicalandcollectionsfor every locale of the taxonomy. -
Updated dependencies [
f58b8f6,5a9d822,c99bcd3,b8fae35,678b848,1b1d443,043960e,f3f7cc3,d177c5e,5eaf095,2e8e063,840a9d3,9a5d5b9,08e93b8,6f1b046,ed51c68,7df822b,21ee693,c78a6cb,ecef5a9,bf6b0a9,ad1465d,f832fe9,4a5241a,2db6c98,e9b70ec,14e9fdd,931b40d,19488ec,26f2076,6ebd4ef,b2f6c06,e4b0d81,baf3010,b804977,4028ee4,90ed23f,66f50dd,6f83886,1796cd5,1796cd5,3be2921,4a69cc6,20858ed,d9f0d85,86a33ee,b5ad2fe,0327f77,ff0ef63]:- emdash@0.40.0
- @emdash-cms/cloudflare@0.40.0
- @emdash-cms/blocks@0.40.0