From 41aa7ec2352b057a4214ae3427e2464c1280fa0e Mon Sep 17 00:00:00 2001 From: colemanw Date: Mon, 11 Sep 2023 19:58:50 -0400 Subject: [PATCH] Afform - Fix js error when setting default value for the first time --- .../admin/ang/afGuiEditor/elements/afGuiField.component.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js index 69c304e5ab..a6124cde53 100644 --- a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js +++ b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js @@ -276,6 +276,7 @@ val = '' + val; if (defaultValueShouldBeArray()) { if (!_.isArray(getSet('afform_default'))) { + ctrl.node.defn = ctrl.node.defn || {}; ctrl.node.defn.afform_default = []; } if (_.includes(ctrl.node.defn.afform_default, val)) { -- 2.25.1