From 3ce691495e9c4f7741002d17df5b620be5f471c2 Mon Sep 17 00:00:00 2001 From: Monish Deb Date: Thu, 7 Apr 2022 18:12:17 -0700 Subject: [PATCH] Schema - Fix boolean fields in 'Friend' --- CRM/Friend/DAO/Friend.php | 6 ++++-- CRM/Upgrade/Incremental/php/FiveFortyNine/Friend.bool.php | 6 ++++++ xml/schema/Friend/Friend.xml | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 CRM/Upgrade/Incremental/php/FiveFortyNine/Friend.bool.php diff --git a/CRM/Friend/DAO/Friend.php b/CRM/Friend/DAO/Friend.php index 19dac5041d..63c192f780 100644 --- a/CRM/Friend/DAO/Friend.php +++ b/CRM/Friend/DAO/Friend.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Friend/Friend.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:49f46991da84d0d0067ea70ab6276f15) + * (GenCodeChecksum:b0719dca7c584cd3d669975119108d78) */ /** @@ -110,7 +110,7 @@ class CRM_Friend_DAO_Friend extends CRM_Core_DAO { public $thankyou_text; /** - * @var bool|string|null + * @var bool|string * (SQL type: tinyint) * Note that values will be retrieved from the database as a string. */ @@ -303,7 +303,9 @@ class CRM_Friend_DAO_Friend extends CRM_Core_DAO { 'name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Enabled?'), + 'required' => TRUE, 'where' => 'civicrm_tell_friend.is_active', + 'default' => '1', 'table_name' => 'civicrm_tell_friend', 'entity' => 'Friend', 'bao' => 'CRM_Friend_BAO_Friend', diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Friend.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Friend.bool.php new file mode 100644 index 0000000000..d1a833f911 --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine/Friend.bool.php @@ -0,0 +1,6 @@ + [ + 'is_active' => "DEFAULT 1", + ], +]; diff --git a/xml/schema/Friend/Friend.xml b/xml/schema/Friend/Friend.xml index 014aee536e..ff6360c946 100644 --- a/xml/schema/Friend/Friend.xml +++ b/xml/schema/Friend/Friend.xml @@ -114,6 +114,8 @@ is_active Enabled? boolean + 1 + true 2.0 CheckBox -- 2.25.1