From 64e21b9443a111f95ec43159831ee0e756b90ca8 Mon Sep 17 00:00:00 2001 From: Daniel Gaull Date: Sun, 10 Nov 2024 15:19:29 -0500 Subject: [PATCH] Added additional checks for operator cardinality, seems to fix #1118 --- packages/core/modules/utils/validation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/modules/utils/validation.js b/packages/core/modules/utils/validation.js index e40e49654..61911afdc 100644 --- a/packages/core/modules/utils/validation.js +++ b/packages/core/modules/utils/validation.js @@ -1383,19 +1383,19 @@ export const getNewValueForFieldOp = function ( // build new values let newValue = currentValue; - if (valueFixes.length > 0 || !canReuseValue) { + if (valueFixes.length > 0 || !canReuseValue || operatorCardinality < currentOperatorCardinality) { newValue = new Immutable.List(Array.from({length: operatorCardinality}, (_ignore, i) => { return valueFixes[i] !== undefined ? valueFixes[i] : (canReuseValue ? currentValue.get(i) : undefined); })); } let newValueSrc = currentValueSrc; - if (valueSrcFixes.length > 0 || !canReuseValue) { + if (valueSrcFixes.length > 0 || !canReuseValue || operatorCardinality < currentOperatorCardinality) { newValueSrc = new Immutable.List(Array.from({length: operatorCardinality}, (_ignore, i) => { return valueSrcFixes[i] ?? (canReuseValue && currentValueSrc.get(i) || null); })); } let newValueType = currentValueType; - if (valueTypeFixes.length > 0 || !canReuseValue) { + if (valueTypeFixes.length > 0 || !canReuseValue || operatorCardinality < currentOperatorCardinality) { newValueType = new Immutable.List(Array.from({length: operatorCardinality}, (_ignore, i) => { return valueTypeFixes[i] ?? (canReuseValue && currentValueType.get(i) || null); }));