diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index 051ac5463..7f2aefc6c 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -1273,8 +1273,8 @@ export const useAssociationNames = (dataSource?: string) => { collectAppends(condition); }); } - - const isTreeCollection = isAssociationField && getCollection(collectionField.target)?.template === 'tree'; + const isTreeCollection = + isAssociationField && getCollection(collectionField.target, dataSource)?.template === 'tree'; if (collectionField && (isAssociationField || isAssociationSubfield) && s['x-component'] !== 'TableField') { const fieldPath = !isAssociationField && isAssociationSubfield ? getAssociationPath(s.name) : s.name; const path = prefix === '' || !prefix ? fieldPath : prefix + '.' + fieldPath;