From: Tim Otten Date: Thu, 26 Jan 2023 04:33:11 +0000 (-0800) Subject: FiveFiftySeven - Point static link to adjustable redirect X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4aa11a265b8d743cdd3742ee84ecf117e7086945;p=civicrm-core.git FiveFiftySeven - Point static link to adjustable redirect --- diff --git a/CRM/Upgrade/Incremental/php/FiveFiftySeven.php b/CRM/Upgrade/Incremental/php/FiveFiftySeven.php index cc58cfbce5..c2a03ab7e1 100644 --- a/CRM/Upgrade/Incremental/php/FiveFiftySeven.php +++ b/CRM/Upgrade/Incremental/php/FiveFiftySeven.php @@ -28,16 +28,19 @@ class CRM_Upgrade_Incremental_php_FiveFiftySeven extends CRM_Upgrade_Incremental public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) { if ($rev === '5.57.alpha1') { + $docUrl = 'https://civicrm.org/redirect/activities-5.57'; + $docAnchor = 'target="_blank" href="' . htmlentities($docUrl) . '"'; + // The query on is_current_revision is slow if there's a lot of activities. So limit when it gets run. $activityCount = CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_activity'); if ($activityCount < self::ACTIVITY_THRESHOLD && CRM_Core_DAO::singleValueQuery('SELECT COUNT(id) FROM civicrm_activity WHERE is_current_revision = 0')) { - $preUpgradeMessage .= '

' . ts('Your database contains CiviCase activity revisions which are deprecated and will begin to appear as duplicates in SearchKit/api4/etc.

', [1 => 'target="_blank" href="https://lab.civicrm.org/-/snippets/85"']) . '

'; + $preUpgradeMessage .= '

' . ts('Your database contains CiviCase activity revisions which are deprecated and will begin to appear as duplicates in SearchKit/api4/etc.

', [1 => $docAnchor]) . '

'; } // Similarly the original_id ON DELETE drop+recreate is slow, so if we // don't add the task farther down below, then tell people what to do at // their convenience. elseif ($activityCount >= self::ACTIVITY_THRESHOLD) { - $preUpgradeMessage .= '

' . ts('Your database contains too many activities to efficiently run a query needed to check for deprecated case activity revisions and to fix a bad foreign key constraint and it may take hours to run. You can run these queries manually at your convenience:

', [1 => 'target="_blank" href="https://lab.civicrm.org/-/snippets/85"']) . '

'; + $preUpgradeMessage .= '

' . ts('Your database contains too many activities to efficiently run a query needed to check for deprecated case activity revisions and to fix a bad foreign key constraint and it may take hours to run. You can run these queries manually at your convenience:

', [1 => $docAnchor]) . '

'; } } }