From: Monish Deb Date: Wed, 18 May 2022 11:41:09 +0000 (+0530) Subject: add pre+post upgrade message X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=abf2cb650ffb4a3fc513540854225e0510abcf2a;p=civicrm-core.git add pre+post upgrade message --- diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine.php b/CRM/Upgrade/Incremental/php/FiveFortyNine.php index 2e6fab7d0f..ab0aa4a82a 100644 --- a/CRM/Upgrade/Incremental/php/FiveFortyNine.php +++ b/CRM/Upgrade/Incremental/php/FiveFortyNine.php @@ -21,13 +21,20 @@ */ class CRM_Upgrade_Incremental_php_FiveFortyNine extends CRM_Upgrade_Incremental_Base { + public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { + if ($rev == '5.49.0' || $rev == '5.49.1') { + $preUpgradeMessage .= '

' . ts('This site previously executed an early version of 5.49, which may have incorrectly modified some scheduled reminders. Some records (%1) should be inspected for accuracy. (Learn more...)', [ + 1 => CRM_Core_DAO::singleValueQuery("SELECT GROUP_CONCAT(id) FROM civicrm_action_schedule WHERE limit_to=0 AND (recipient_manual IS NOT NULL OR group_id IS NOT NULL)"), + 2 => 'target="blank" href="https://civicrm.org/redirect/reminders-5.49"', + ]); + } + } + public function setpostUpgradeMessage(&$preUpgradeMessage, $rev) { - if ($rev == '5.49.beta1') { - if ($this->hasConfigBackendData()) { - $postUpgradeMessage .= '
' . ts("WARNING: The column \"civicrm_action_schedule.limit_to\" is now a required boolean field. Please ensure all the schedule reminders (especially with 'Also Include' option) are correct. For more detail please check here.", [ - 1 => 'https://lab.civicrm.org/dev/core/-/issues/3464', - ]); - } + if ($rev == '5.49.beta1' || $rev == '5.49.0' || $rev == '5.49.1') { + $postUpgradeMessage .= '
' . ts("WARNING: The column \"civicrm_action_schedule.limit_to\" is now a required boolean field. Please ensure all the schedule reminders (especially with 'Also Include' option) are correct. For more detail please check here.", [ + 1 => 'https://lab.civicrm.org/dev/core/-/issues/3464', + ]); } } @@ -75,8 +82,8 @@ class CRM_Upgrade_Incremental_php_FiveFortyNine extends CRM_Upgrade_Incremental_ * * @param string $rev */ - public function upgrade_5_49_2($rev) { - if (version_compare(CRM_Core_BAO_Domain::version(), '5.49', '>=') { + public function upgrade_5_49_0($rev) { + if (version_compare(CRM_Core_BAO_Domain::version(), '5.49.beta1', '>=')) { $this->addtask('Revert civicrm_action_schedule.limit_to to be NULL', 'changeBooleanColumnLimitTo'); } }