From 01e81f48c2257d3ca8a36b0d46fe555ce26e8733 Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Thu, 19 Dec 2024 21:16:35 +0200 Subject: [PATCH] Use values from the innermost collection instead of the outermost one. --- .../model/collection_component/CollectionComponent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts b/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts index a1d0d6cca..bdfeef199 100644 --- a/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts +++ b/packages/core/src/data_sources/model/collection_component/CollectionComponent.ts @@ -144,6 +144,7 @@ function resolveBlockValues(context: any, block: any): any { for (const key of blockKeys) { let blockValue = clonedBlock[key]; + if (key === 'collectionDefinition') continue; if (typeof blockValue === 'object' && blockValue !== null) { if (blockValue.type === 'parent-collection-variable') { @@ -160,7 +161,7 @@ function resolveBlockValues(context: any, block: any): any { break; default: clonedBlock[key] = collectionItem[blockValue.variable_type]; - break; // Handle unexpected variable types gracefully + break; } } else if (Array.isArray(blockValue)) { // Resolve each item in the array