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

index f5ce8c71717caec3f69f51aebd1402b0f79a78e3..69b1eac776f386e1594f3164649071bd462adeab 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Report/ReportInstance.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0cc1db696d0899940ac62d266cb55a0a)
+ * (GenCodeChecksum:588c8712caae98e6765ac8ed21c9e6b2)
  */
 
 /**
@@ -131,7 +131,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
   /**
    * Is this entry active?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -219,7 +219,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
   public $drilldown_id;
 
   /**
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -449,7 +449,9 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Report Instance is Active'),
           'description' => ts('Is this entry active?'),
+          'required' => TRUE,
           'where' => 'civicrm_report_instance.is_active',
+          'default' => '1',
           'table_name' => 'civicrm_report_instance',
           'entity' => 'ReportInstance',
           'bao' => 'CRM_Report_BAO_ReportInstance',
@@ -612,6 +614,7 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO {
           'name' => 'is_reserved',
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Instance is Reserved'),
+          'required' => TRUE,
           'where' => 'civicrm_report_instance.is_reserved',
           'default' => '0',
           'table_name' => 'civicrm_report_instance',
diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Report.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Report.bool.php
new file mode 100644 (file)
index 0000000..545e3ed
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+return [
+  'civicrm_report_instance' => [
+    'is_active' => "DEFAULT 0 COMMENT 'Is this entry active?'",
+    'is_reserved' => "DEFAULT 0",
+  ],
+  'civicrm_report_instance' => [
+    'is_active' => "DEFAULT 1 COMMENT 'Is this entry active?'",
+  ],
+    // WTF
+];
index e020ec3149aea51022fe76a5026988f81d04c73e..58cf3b8c4d2c206159045b2f1fcc4ec5db2a5af6 100644 (file)
     <name>is_active</name>
     <title>Report Instance is Active</title>
     <type>boolean</type>
+    <default>1</default>
+    <required>true</required>
     <comment>Is this entry active?</comment>
     <html>
       <type>CheckBox</type>
     <title>Instance is Reserved</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <html>
       <type>CheckBox</type>
     </html>