From 3ce9690c6dfee58a81d9003c8191bb33d0cddb88 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Thu, 19 Feb 2026 12:57:59 -0500 Subject: [PATCH] fix(next): conditionally query snapshot field based on localization The snapshot field only exists in version schemas when localization is enabled. The Versions view was unconditionally querying this field, causing "path cannot be queried: snapshot" errors for collections without localization (e.g., trash tests). This aligns with the existing pattern at lines 53-59 in the same file. --- packages/next/src/views/Versions/index.tsx | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/next/src/views/Versions/index.tsx b/packages/next/src/views/Versions/index.tsx index c9bdaf405a4..6457373129b 100644 --- a/packages/next/src/views/Versions/index.tsx +++ b/packages/next/src/views/Versions/index.tsx @@ -101,11 +101,13 @@ export async function VersionsView(props: DocumentViewServerProps) { }, status: 'published', user, - where: { - snapshot: { - not_equals: true, - }, - }, + where: localization + ? { + snapshot: { + not_equals: true, + }, + } + : undefined, }) : Promise.resolve(null), draftsEnabled @@ -127,11 +129,13 @@ export async function VersionsView(props: DocumentViewServerProps) { }, status: 'draft', user, - where: { - snapshot: { - not_equals: true, - }, - }, + where: localization + ? { + snapshot: { + not_equals: true, + }, + } + : undefined, }) : Promise.resolve(null), ])