diff --git a/packages/editor-ui/src/components/FixedCollectionParameter.vue b/packages/editor-ui/src/components/FixedCollectionParameter.vue index 9588e51a80..2d10f5b3ad 100644 --- a/packages/editor-ui/src/components/FixedCollectionParameter.vue +++ b/packages/editor-ui/src/components/FixedCollectionParameter.vue @@ -177,7 +177,11 @@ export default mixins(genericHelpers) } else if (optionParameter.typeOptions !== undefined && optionParameter.typeOptions.multipleValues === true) { // Multiple values are allowed so append option to array newParameterValue[optionParameter.name] = get(this.nodeValues, `${this.path}.${optionParameter.name}`, []); - (newParameterValue[optionParameter.name] as INodeParameters[]).push(JSON.parse(JSON.stringify(optionParameter.default))); + if (Array.isArray(optionParameter.default)) { + (newParameterValue[optionParameter.name] as INodeParameters[]).push(...JSON.parse(JSON.stringify(optionParameter.default))); + } else if (optionParameter.default !== '' && typeof optionParameter.default !== 'object') { + (newParameterValue[optionParameter.name] as INodeParameters[]).push(JSON.parse(JSON.stringify(optionParameter.default))); + } } else { // Add a new option newParameterValue[optionParameter.name] = JSON.parse(JSON.stringify(optionParameter.default)); diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index 0a86250e2a..018ea8c4b6 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -613,7 +613,13 @@ export function getNodeParameters(nodePropertiesArray: INodeProperties[], nodeVa nodeParameters[nodeProperties.name] = nodeValues[nodeProperties.name]; } else if (returnDefaults === true) { // Does not have values defined but defaults should be returned - nodeParameters[nodeProperties.name] = JSON.parse(JSON.stringify(nodeProperties.default)); + if (Array.isArray(nodeProperties.default)) { + nodeParameters[nodeProperties.name] = JSON.parse(JSON.stringify(nodeProperties.default)); + } else { + // As it is probably wrong for many nodes, do we keep on returning an empty array if + // anything else than an array is set as default + nodeParameters[nodeProperties.name] = []; + } } nodeParametersFull[nodeProperties.name] = nodeParameters[nodeProperties.name]; } else {