github emdash-cms/emdash @emdash-cms/plugin-test@0.2.2

3 hours ago

Patch Changes

  • #3360 6f83886 Thanks @danielmlr! - Updates taxonomy definitions so hierarchical and collections belong 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. label and labelSingular stay per locale.

    This changes behavior for multilingual sites:

    • PUT /_emdash/api/taxonomies/{name} and the MCP taxonomy_update tool change hierarchical and collections for every locale, even when locale is 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's hierarchical and collections; a create that sends different values returns VALIDATION_ERROR, where it previously stored them for the new locale only. Change them with an update instead.
    • getTaxonomyTerms(), getTaxonomyDef() and getTaxonomyDefs() 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 hierarchical and collections on a taxonomy entry whose translationOf points at an entry with the same name. Applying a seed follows translationOf through entries with the same name and 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 exported SeedTaxonomy type marks both fields optional, so code that reads them from a seed must handle undefined. emdash export-seed writes 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 hierarchical or collections values per locale on purpose, check them after upgrading and set the values you want once.

    If your code changes hierarchical or collections by writing to _emdash_taxonomy_defs with SQL, use the taxonomy API, the MCP taxonomy_update tool 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() sets hierarchical and collections for 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

Don't miss a new emdash release

NewReleases is sending notifications on new releases.