From 2fc13c180c009253518a00dadae50ba62a358588 Mon Sep 17 00:00:00 2001 From: jack zhang <1098626505@qq.com> Date: Fri, 8 Mar 2024 11:18:32 +0800 Subject: [PATCH] fix: getCollection bug (#3656) --- packages/core/client/src/block-provider/hooks/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;