diff --git a/src/collections/Posts/index.ts b/src/collections/Posts/index.ts index 660cebfe..2de5ae81 100644 --- a/src/collections/Posts/index.ts +++ b/src/collections/Posts/index.ts @@ -194,6 +194,9 @@ export const Posts: CollectionConfig = { }, hasMany: true, relationTo: "lyovsons", + // Drafts may leave it empty; publishing needs an author (a post lost + // its authors in Jan 2026 and stayed published without one). + required: true, }, // This field is only used to populate the user data via the `populateAuthors` hook // This is because the `user` collection has access control locked to protect user privacy diff --git a/src/payload-types.ts b/src/payload-types.ts index 4c891c96..0a36334e 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -301,7 +301,7 @@ export interface Post { /** * Who authored this post */ - authors?: (number | Lyovson)[] | null; + authors: (number | Lyovson)[]; populatedAuthors?: | { id?: string | null; diff --git a/src/utilities/syndication-feed.test.ts b/src/utilities/syndication-feed.test.ts index 0c70b8c6..d3deca7e 100644 --- a/src/utilities/syndication-feed.test.ts +++ b/src/utilities/syndication-feed.test.ts @@ -23,6 +23,7 @@ const post: Post = { publishedAt, createdAt: publishedAt, updatedAt: publishedAt, + authors: [1], populatedAuthors: [{ id: "1", name: "Rafa Lyóvson", username: "rafa" }], project: { _status: "published",