fix(core): persist taxonomies field on content_create/content_update MCP tools#1841
Closed
marcusbellamyshaw-cell wants to merge 1 commit into
Closed
Conversation
…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 detectedLatest commit: c68b834 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Contributor
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
18 tasks
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. |
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.
What does this PR do?
Both MCP tools accepted a
taxonomiesfield 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 (resolveTermReffalls back to a slug lookup scoped to the taxonomy name, sinceresolveTranslationGrouponly matches id/group). Threaded throughhandleContentCreate/handleContentUpdatein the same transaction as the content write, mirroring the existing bylines wiring. On create, explicit taxonomies win over whatevercopyEntryTermsinherited from atranslationOfsource.Closes #953
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
packages/core/tests/integration/mcp/content-taxonomies.test.ts— 3/3 pass;pnpm lint:quickclean;pnpm typecheckclean.Opened as draft: fork already has several open PRs against this repo (non-collaborator open-PR limit).