Schema - Fix boolean fields in 'Case'
authorMonish Deb <monish.deb@jmaconsulting.biz>
Fri, 8 Apr 2022 01:12:16 +0000 (18:12 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 8 Apr 2022 01:12:16 +0000 (18:12 -0700)
CRM/Case/DAO/Case.php
CRM/Case/DAO/CaseType.php
CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php [new file with mode: 0644]
xml/schema/Case/Case.xml
xml/schema/Case/CaseType.xml

index 49e5ba56110870951f1de53b9653d007f349e956..55a008310501f65894c7801d51a4e4af26dcf86b 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/Case.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9255efc8fc0b791899a006e23eb55341)
+ * (GenCodeChecksum:cc7bc9034e7487e1913aa45fc4c119b8)
  */
 
 /**
@@ -109,7 +109,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO {
   public $status_id;
 
   /**
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -326,6 +326,7 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO {
           'name' => 'is_deleted',
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Case is in the Trash'),
+          'required' => TRUE,
           'import' => TRUE,
           'where' => 'civicrm_case.is_deleted',
           'export' => TRUE,
index 8b5f4651a4341614b60081bebdb502e43421f018..3fbe29126dbb1cb04da986e0ba7443da79561ae2 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Case/CaseType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:1102802dc49a9899f93c16fce57fa141)
+ * (GenCodeChecksum:7b3029a4b42f22a060fadb39b7b2c678)
  */
 
 /**
@@ -70,7 +70,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
   /**
    * Is this case type enabled?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -79,7 +79,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
   /**
    * Is this case type a predefined system type?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -195,6 +195,7 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Case Type Is Active'),
           'description' => ts('Is this case type enabled?'),
+          'required' => TRUE,
           'where' => 'civicrm_case_type.is_active',
           'default' => '1',
           'table_name' => 'civicrm_case_type',
@@ -208,7 +209,9 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Case Type Is Reserved'),
           'description' => ts('Is this case type a predefined system type?'),
+          'required' => TRUE,
           'where' => 'civicrm_case_type.is_reserved',
+          'default' => '0',
           'table_name' => 'civicrm_case_type',
           'entity' => 'CaseType',
           'bao' => 'CRM_Case_BAO_CaseType',
diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Case.bool.php
new file mode 100644 (file)
index 0000000..c108542
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+return [
+  'civicrm_case' => [
+    'is_deleted' => "DEFAULT 0",
+  ],
+  'civicrm_case_type' => [
+    'is_active' => "DEFAULT 1 COMMENT 'Is this case type enabled?'",
+    'is_reserved' => "DEFAULT 0 COMMENT 'Is this case type a predefined system type?'",
+  ],
+];
index acc66e4ede1f9eaf94268b1002c9a19ed17688d2..d26e06f56a96e9334405ad50bd023d999a48a696 100644 (file)
     <uniqueName>case_deleted</uniqueName>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <import>true</import>
     <html>
       <type>CheckBox</type>
index ba361ba9e1abe45e2f87f924b796e9ea9c09dd93..3c8a18ff5559d9f51b8b3cff315097d76e22fd93 100644 (file)
     <type>boolean</type>
     <comment>Is this case type enabled?</comment>
     <default>1</default>
+    <required>true</required>
     <add>4.5</add>
   </field>
   <field>
     <name>is_reserved</name>
     <title>Case Type Is Reserved</title>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Is this case type a predefined system type?</comment>
     <add>4.5</add>
   </field>