Afform - Fix js error when setting default value for the first time
authorcolemanw <coleman@civicrm.org>
Mon, 11 Sep 2023 23:58:50 +0000 (19:58 -0400)
committercolemanw <coleman@civicrm.org>
Mon, 11 Sep 2023 23:58:50 +0000 (19:58 -0400)
ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js

index 69c304e5ab5058fcf9a5de41d7130c533d8e88c0..a6124cde53c5a4e3349605cfa0893a58a90e1faf 100644 (file)
         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)) {