From 110f4343ff243da789e85cdfd8a96818134f9305 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 15 May 2018 07:54:14 +1000 Subject: [PATCH] Set Default values on is_active, is_searchable, is_view and is_active on civicrm_custom_field --- CRM/Core/DAO/CustomField.php | 3 ++- CRM/Core/DAO/CustomGroup.php | 3 ++- CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl | 7 +++++++ xml/schema/Core/CustomField.xml | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index 23114402d1..1f48b8858f 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6c4ced0a0ac204cde5c048d37aee6057) + * (GenCodeChecksum:dcb494bf3990ce63b66ef13ee47a2d15) */ /** @@ -475,6 +475,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Custom Field Is Active?'), 'description' => 'Is this property active?', + 'default' => '1', 'table_name' => 'civicrm_custom_field', 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', diff --git a/CRM/Core/DAO/CustomGroup.php b/CRM/Core/DAO/CustomGroup.php index f747321fd9..93d8214055 100644 --- a/CRM/Core/DAO/CustomGroup.php +++ b/CRM/Core/DAO/CustomGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e0236d574279679e242f45bc73c4680a) + * (GenCodeChecksum:6b88842459aadee0598c08bd4d7518f2) */ /** @@ -361,6 +361,7 @@ class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO { 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Custom Group Is Active?'), 'description' => 'Is this property active?', + 'default' => '1', 'table_name' => 'civicrm_custom_group', 'entity' => 'CustomGroup', 'bao' => 'CRM_Core_BAO_CustomGroup', diff --git a/CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl index 7f5b095e95..29672bcf24 100644 --- a/CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.3.alpha1.mysql.tpl @@ -2,3 +2,10 @@ ALTER TABLE civicrm_custom_group ALTER column is_multiple SET DEFAULT 0; UPDATE civicrm_custom_group SET is_multiple = 0 WHERE is_multiple IS NULL; ALTER TABLE civicrm_custom_group ALTER column is_active SET DEFAULT 1; +ALTER TABLE civicrm_custom_field ALTER column is_view SET DEFAULT 0; +UPDATE civicrm_custom_field SET is_view = 0 WHERE is_view IS NULL; +ALTER TABLE civicrm_custom_field ALTER column is_required SET DEFAULT 0; +UPDATE civicrm_custom_field SET is_required = 0 WHERE is_required IS NULL; +ALTER TABLE civicrm_custom_field ALTER column is_searchable SET DEFAULT 0; +UPDATE civicrm_custom_field SET is_searchable = 0 WHERE is_required IS NULL; +ALTER TABLE civicrm_custom_field ALTER column is_active SET DEFAULT 1; diff --git a/xml/schema/Core/CustomField.xml b/xml/schema/Core/CustomField.xml index d9ee5bb74c..0effe4046d 100644 --- a/xml/schema/Core/CustomField.xml +++ b/xml/schema/Core/CustomField.xml @@ -100,6 +100,7 @@ Custom Field Is Required? boolean Is a value required for this property. + 0 1.1 @@ -107,6 +108,7 @@ Allow Searching on Field? boolean Is this property searchable. + 0 1.1 @@ -171,12 +173,14 @@ boolean Custom Field Is Active? Is this property active? + 1 1.1 is_view boolean Field is Viewable + 0 Is this property set by PHP Code? A code field is viewable but not editable 1.1 -- 2.25.1