fix(data): creating a table holds only the mandatory built-ins, matching patch - #458
Merged
Merged
Conversation
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.
Creating a post type re-added every missing built-in field, including the optional ones (body, featured media, SEO title, SEO description). The New collection dialog lets an author delete those before creating, so the server silently overrode the author's explicit choice: the created table carried all three deleted fields again. The PATCH path already enforces the intended rule and documents it (only
titleandslugare held; the optional built-ins are deliberately removable).The create path now holds only the mandatory two, exactly like PATCH. A caller that supplies no fields at all still receives the full canonical set, so bare creates through the data API or an MCP connector stay routable and useful.
Found by the CONTENT-006 e2e spec while repairing the suite: it deletes the three optional fields during creation and then checks the new entry's settings panel, and the created table in the database still contained all three.
Verification: two new regression tests in postTypeBuiltInFields.test.ts (removal respected; empty list still seeds the canonical set), bun test 6703 pass, bun run build and bun run lint clean.