1.18.0 (owner's decisions Q3, Q4, Q5): writes that keep others' saves, access answers announced, drafts out of related documents
- Q3: the integration status (emailStatus, turnstileStatus) is written alone through the database adapter (writeGlobalFields, exported): a visitor's form submit no longer puts back an admin's SMTP or Turnstile change saved at the same moment. addToCookieList reads the list again right before writing and works the change out again when an editor's save changed it (up to 5 times). Both races reproduced exactly in test/statusWrites.test.ts, on the three adapters. - Q4: cookieScanner.access and the doctor's access go through accessAllowed: any truthy answer still allows, an answer that is not a boolean is reported once per option; strict (only true) is announced for 1.19.0. - Q5: related documents that are drafts are left out of what the public helpers answer (resolveRoute, getSettings, getArchiveEntries, the 404 page, llms-full; Markdown and MCP through resolveRoute): null alone, removed from a list, value null in a polymorphic one. A preview keeps them; draftRelations: 'keep' keeps the old behaviour. withoutDraftRelations, applyDraftRelations exported. - Docs: content.md, frontend.md, integrations.md, cookie-scanner.md, security.md, AGENT.md; iapl-nav and iapl-doctor skills. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fc70a34f3e
commit
21ef0fdeb0
@@ -1,8 +1,11 @@
|
||||
import type { BasePayload } from 'payload'
|
||||
|
||||
import { applyDraftRelations, type DraftRelations } from './draftRelations.js'
|
||||
import { isPublishedDoc } from './resolveRoute.js'
|
||||
|
||||
type ResolveNotFoundPageArgs = {
|
||||
/** Related documents that are drafts: `'hide'` (default since 1.18.0) leaves them out, `'keep'` as before. */
|
||||
draftRelations?: DraftRelations
|
||||
locale: string
|
||||
/** Client's Pages collection slug. Defaults to 'pages'. */
|
||||
pagesSlug?: string
|
||||
@@ -24,6 +27,7 @@ type ResolveNotFoundPageArgs = {
|
||||
* deleted page just yields null, so the 404 view can't crash the build.
|
||||
*/
|
||||
export async function resolveNotFoundPage({
|
||||
draftRelations,
|
||||
locale,
|
||||
pagesSlug = 'pages',
|
||||
payload,
|
||||
@@ -52,7 +56,7 @@ export async function resolveNotFoundPage({
|
||||
locale: locale as never,
|
||||
})
|
||||
// a page never published (or unpublished) is a draft: the built-in view, not its text (IAWL idea 23)
|
||||
return isPublishedDoc(doc) ? (doc as Record<string, unknown>) : null
|
||||
return isPublishedDoc(doc) ? applyDraftRelations(doc as Record<string, unknown>, { draftRelations }) : null
|
||||
} catch (error) {
|
||||
console.warn('[iapl] resolveNotFoundPage: falling back to built-in 404 view:', error)
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user