From b8be3222c1b9a6e5f660f8a6787641b0084a4da7 Mon Sep 17 00:00:00 2001 From: demeritcowboy <demeritcowboy@hotmail.com> Date: Mon, 15 Jun 2020 19:32:47 -0400 Subject: [PATCH] fix missing newly created activity types --- CRM/Core/DAO/OptionValue.php | 4 ++-- CRM/Upgrade/Incremental/sql/5.27.beta1.mysql.tpl | 7 +++++++ xml/schema/Core/OptionValue.xml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CRM/Core/DAO/OptionValue.php b/CRM/Core/DAO/OptionValue.php index 279f18540ea..c2418be5977 100644 --- a/CRM/Core/DAO/OptionValue.php +++ b/CRM/Core/DAO/OptionValue.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/OptionValue.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7aa11987c26800632c3798b4cfce95c1) + * (GenCodeChecksum:5997192c77d86867e8d13c353dd02351) */ /** @@ -281,7 +281,7 @@ class CRM_Core_DAO_OptionValue extends CRM_Core_DAO { 'title' => ts('Filter'), 'description' => ts('Bitwise logic can be used to create subsets of options within an option_group for different uses.'), 'where' => 'civicrm_option_value.filter', - 'default' => 'NULL', + 'default' => '0', 'table_name' => 'civicrm_option_value', 'entity' => 'OptionValue', 'bao' => 'CRM_Core_BAO_OptionValue', diff --git a/CRM/Upgrade/Incremental/sql/5.27.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.27.beta1.mysql.tpl index 975881c87d2..699d61878c7 100644 --- a/CRM/Upgrade/Incremental/sql/5.27.beta1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.27.beta1.mysql.tpl @@ -1 +1,8 @@ {* file to handle db changes in 5.27.beta1 during upgrade *} +ALTER TABLE civicrm_option_value MODIFY COLUMN `filter` int unsigned DEFAULT 0 COMMENT 'Bitwise logic can be used to create subsets of options within an option_group for different uses.'; + +-- To think about: This will update ones where someone has explicitly set it to NULL for their own purposes and they don't care about the dropdowns. How likely is that? How can we tell if it's one they created since 5.26 and didn't intend to set it to NULL? +UPDATE civicrm_option_value ov +INNER JOIN civicrm_option_group og ON (ov.option_group_id = og.id AND og.name='activity_type') +SET ov.filter = 0 +WHERE ov.filter IS NULL; diff --git a/xml/schema/Core/OptionValue.xml b/xml/schema/Core/OptionValue.xml index f3a767d0645..ce81cc6822a 100644 --- a/xml/schema/Core/OptionValue.xml +++ b/xml/schema/Core/OptionValue.xml @@ -82,7 +82,7 @@ <field> <name>filter</name> <type>int unsigned</type> - <default>NULL</default> + <default>0</default> <comment>Bitwise logic can be used to create subsets of options within an option_group for different uses.</comment> <add>1.5</add> </field> -- GitLab