fix: #1887, dataloader rich text population infinite loop

This commit is contained in:
James
2023-02-07 14:35:37 -05:00
parent cff6608996
commit ac2e174643
3 changed files with 126 additions and 7 deletions

View File

@@ -31,16 +31,16 @@ export const populate = async ({
}): Promise<void> => {
const dataRef = data as Record<string, unknown>;
const doc = await req.payload.findByID({
req,
collection: collection.config.slug,
const doc = await req.payloadDataLoader.load(JSON.stringify([
collection.config.slug,
id,
currentDepth: currentDepth + 1,
overrideAccess: typeof overrideAccess === 'undefined' ? false : overrideAccess,
disableErrors: true,
depth,
currentDepth + 1,
req.locale,
req.fallbackLocale,
typeof overrideAccess === 'undefined' ? false : overrideAccess,
showHiddenFields,
});
]));
if (doc) {
dataRef[key] = doc;