Fix o2m nested image thumbnail extraction (#11251)

Fixes #10105
This commit is contained in:
Rijk van Zanten
2022-01-24 18:11:32 -05:00
committed by GitHub
parent fc50dea18e
commit 9ba2a3fc52

View File

@@ -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) {