From: Tim Otten Date: Wed, 18 May 2022 22:02:12 +0000 (-0700) Subject: FiveFortyNine - Don't munge soft credit 'limit-to' X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=956bf414e942f8553f04eb145e2ac3daedb98d61;p=civicrm-core.git FiveFortyNine - Don't munge soft credit 'limit-to' I'm not sure what it even means to limit a scheduled-reminder to a "soft_credit_type". But it's a thing - I can use the 5.48 GUI to create it. Here's how it looks in the DB (in 5.48): +----+------------------------------------------+------------------+----------+------------------+-------------------+----------+ | id | title | recipient | limit_to | recipient_manual | recipient_listing | group_id | +----+------------------------------------------+------------------+----------+------------------+-------------------+----------+ | 11 | Limit To - Soft Credit | soft_credit_type | 1 | NULL | in_memory_of | NULL | +----+------------------------------------------+------------------+----------+------------------+-------------------+----------+ The `changeBooleanColumnLimitTo()` was coercing down to `limit_to=null` because it lacked `recipient_manual` and `group_id`. --- diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine.php b/CRM/Upgrade/Incremental/php/FiveFortyNine.php index 1573d3f8ee..58332a54c8 100644 --- a/CRM/Upgrade/Incremental/php/FiveFortyNine.php +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine.php @@ -101,7 +101,7 @@ class CRM_Upgrade_Incremental_php_FiveFortyNine extends CRM_Upgrade_Incremental_ */ public static function changeBooleanColumnLimitTo() { CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_action_schedule` CHANGE `limit_to` `limit_to` tinyint NULL COMMENT 'Is this the recipient criteria limited to OR in addition to?'", [], TRUE, NULL, FALSE, FALSE); - CRM_Core_DAO::executeQuery("UPDATE `civicrm_action_schedule` SET `limit_to` = NULL WHERE `group_id` IS NULL AND recipient_manual IS NULL", [], TRUE, NULL, FALSE, FALSE); + CRM_Core_DAO::executeQuery("UPDATE `civicrm_action_schedule` SET `limit_to` = NULL WHERE `limit_to` = 0 AND `group_id` IS NULL AND recipient_manual IS NULL", [], TRUE, NULL, FALSE, FALSE); return TRUE; }