Afform - Add default values to metadata
authorcolemanw <coleman@civicrm.org>
Thu, 19 Oct 2023 13:24:09 +0000 (09:24 -0400)
committercolemanw <coleman@civicrm.org>
Thu, 19 Oct 2023 13:24:09 +0000 (09:24 -0400)
ext/afform/core/Civi/Api4/Afform.php

index dfd1f13d0a794873c26ca9f3f0c2132a61a8f01c..214ed88e5a6c7b6c501b10ed5c803eac42f550d1 100644 (file)
@@ -140,6 +140,7 @@ class Afform extends Generic\AbstractEntity {
           'name' => 'type',
           'title' => E::ts('Type'),
           'pseudoconstant' => ['optionGroupName' => 'afform_type'],
+          'default_value' => 'form',
         ],
         [
           'name' => 'requires',
@@ -195,16 +196,19 @@ class Afform extends Generic\AbstractEntity {
           'name' => 'is_public',
           'title' => E::ts('Is Public'),
           'data_type' => 'Boolean',
+          'default_value' => FALSE,
         ],
         [
           'name' => 'permission',
           'title' => E::ts('Permission'),
           'data_type' => 'Array',
+          'default_value' => ['access CiviCRM'],
         ],
         [
           'name' => 'permission_operator',
           'title' => E::ts('Permission Operator'),
           'data_type' => 'String',
+          'default_value' => 'AND',
           'options' => \CRM_Core_SelectValues::andOr(),
         ],
         [