Skip to content

fix(core): persist taxonomies field on content_create/content_update MCP tools#1841

Closed
marcusbellamyshaw-cell wants to merge 1 commit into
emdash-cms:mainfrom
Emdash-Bug-Testing:fix/953-mcp-content-taxonomies
Closed

fix(core): persist taxonomies field on content_create/content_update MCP tools#1841
marcusbellamyshaw-cell wants to merge 1 commit into
emdash-cms:mainfrom
Emdash-Bug-Testing:fix/953-mcp-content-taxonomies

Conversation

@marcusbellamyshaw-cell

Copy link
Copy Markdown
Contributor

What does this PR do?

Both MCP tools accepted a taxonomies field without error but never persisted it — the input schemas didn't declare it and nothing in the handler chain forwarded it to the taxonomy junction table. #621 added SEO and byline support the same way; taxonomies was the one field left out.

Adds TaxonomyRepository.setTaxonomiesForEntry(), keyed by taxonomy name with each value a list of term refs. Refs may be a term id or a slug (resolveTermRef falls back to a slug lookup scoped to the taxonomy name, since resolveTranslationGroup only matches id/group). Threaded through handleContentCreate/handleContentUpdate in the same transaction as the content write, mirroring the existing bylines wiring. On create, explicit taxonomies win over whatever copyEntryTerms inherited from a translationOf source.

Closes #953

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (n/a — MCP tool, no admin UI strings)
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion (n/a — bug fix)

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Sonnet 5

Screenshots / test output

packages/core/tests/integration/mcp/content-taxonomies.test.ts — 3/3 pass; pnpm lint:quick clean; pnpm typecheck clean.

Opened as draft: fork already has several open PRs against this repo (non-collaborator open-PR limit).

…MCP tools (emdash-cms#953)

Both MCP tools accepted a taxonomies field without error but never
persisted it -- the input schemas didn't declare it and nothing in
the handler chain forwarded it to the taxonomy junction table. emdash-cms#621
added SEO and byline support the same way; taxonomies was the one
field left out.

Adds TaxonomyRepository.setTaxonomiesForEntry(), keyed by taxonomy
name with each value a list of term refs. Refs may be a term id or a
slug (resolveTermRef falls back to a slug lookup scoped to the
taxonomy name, since resolveTranslationGroup only matches id/group).
Threaded through handleContentCreate/handleContentUpdate in the same
transaction as the content write, mirroring the existing bylines
wiring. On create, explicit taxonomies win over whatever
copyEntryTerms inherited from a translationOf source.

Co-Authored-By: Claude Opus 4.8 ultracode <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c68b834

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1841

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1841

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@1841

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1841

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1841

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@1841

emdash

npm i https://pkg.pr.new/emdash@1841

create-emdash

npm i https://pkg.pr.new/create-emdash@1841

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1841

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@1841

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@1841

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@1841

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@1841

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@1841

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1841

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1841

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1841

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1841

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1841

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1841

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@1841

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1841

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1841

commit: c68b834

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@ascorbic

ascorbic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. I'm going to close this as it is now redundant. I've merged #1874 which solved the same issue, but in a way that covered more of the edge cases.

@ascorbic ascorbic closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: content_create/content_update ignores taxonomies field (categories/tags not assigned)

2 participants