From 852d85199688ddd940f9c0e8d062ae538bbcb987 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Wed, 29 Oct 2025 12:36:43 +0800 Subject: [PATCH] fix(workflow): add empty array validation for required checklist fields in trigger plugin The checkValid function was not properly validating required checklist fields when they had empty array values. This caused required fields to pass validation even when no options were selected. Added array length check to the constant type validation to ensure required checklist fields must have at least one selected option. --- .../components/workflow/nodes/trigger-plugin/default.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/nodes/trigger-plugin/default.ts b/web/app/components/workflow/nodes/trigger-plugin/default.ts index c994007e82..928534e07c 100644 --- a/web/app/components/workflow/nodes/trigger-plugin/default.ts +++ b/web/app/components/workflow/nodes/trigger-plugin/default.ts @@ -272,7 +272,12 @@ const nodeDefault: NodeDefault = { errorMessage = t('workflow.errorMsg.fieldRequired', { field: field.label }) } else { - if (value === undefined || value === null || value === '') + if ( + value === undefined + || value === null + || value === '' + || (Array.isArray(value) && value.length === 0) + ) errorMessage = t('workflow.errorMsg.fieldRequired', { field: field.label }) } })