From 9ba2a3fc52e9cfa73bd98c980fdbaf54278b2530 Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Mon, 24 Jan 2022 18:11:32 -0500 Subject: [PATCH] Fix o2m nested image thumbnail extraction (#11251) Fixes #10105 --- app/src/displays/related-values/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/displays/related-values/index.ts b/app/src/displays/related-values/index.ts index a904f0409d..b9648f1031 100644 --- a/app/src/displays/related-values/index.ts +++ b/app/src/displays/related-values/index.ts @@ -46,14 +46,14 @@ export default defineDisplay({ types: ['alias', 'string', 'uuid', 'integer', 'bigInteger', 'json'], localTypes: ['m2m', 'm2o', 'o2m', 'translations', 'm2a', 'file', 'files'], fields: (options: Options | null, { field, collection }) => { - const { relatedCollection, path } = getRelatedCollection(collection, field); + const { junctionCollection, relatedCollection, path } = getRelatedCollection(collection, field); const fieldsStore = useFieldsStore(); const primaryKeyField = fieldsStore.getPrimaryKeyFieldForCollection(relatedCollection); if (!relatedCollection) return []; const fields = options?.template - ? adjustFieldsForDisplays(getFieldsFromTemplate(options.template), relatedCollection) + ? adjustFieldsForDisplays(getFieldsFromTemplate(options.template), junctionCollection ?? relatedCollection) : []; if (primaryKeyField) {