From: Luke Stewart Date: Mon, 15 May 2023 21:52:04 +0000 (+1200) Subject: Adds warning similar to 5.57 if Activity Revisions are present. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ce1575e027e82039d07191b009ad69bcb81b5ea6;p=civicrm-core.git Adds warning similar to 5.57 if Activity Revisions are present. Checks if upgrade is from version after 5.57.alpha1 If so check for any activities which are not the current revision Issue warning. Notes: - Doesn't check if Foreign Key on delete trigger was updated to prevent deletion - Doesn't warn about the above - we assume this is covered in the steps people will follow in the link - or that they will have done this already. --- diff --git a/CRM/Upgrade/Incremental/php/FiveSixtyTwo.php b/CRM/Upgrade/Incremental/php/FiveSixtyTwo.php index 031977cb90..99e1eeea13 100644 --- a/CRM/Upgrade/Incremental/php/FiveSixtyTwo.php +++ b/CRM/Upgrade/Incremental/php/FiveSixtyTwo.php @@ -44,6 +44,19 @@ class CRM_Upgrade_Incremental_php_FiveSixtyTwo extends CRM_Upgrade_Incremental_B } } } + elseif ($rev == '5.62.beta1') { + // Copied from FiveFiftySeven, only display if we upgrading from version after 5.57.alpha1 + if (version_compare($currentVer, '5.57.alpha1', '>')) { + $docUrl = 'https://civicrm.org/redirect/activities-5.57'; + $docAnchor = 'target="_blank" href="' . htmlentities($docUrl) . '"'; + if (CRM_Core_DAO::singleValueQuery('SELECT COUNT(id) FROM civicrm_activity WHERE is_current_revision = 0')) { + // Text copied from FiveFifty Seven + $preUpgradeMessage .= '

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

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

'; + // New text explaination as to why we show this again. + $preUpgradeMessage .= '

' . ts('Note: You might have followed these steps already but unfortunately a previous upgrade which started ignoring the setting to create CiviCase Activity revisions failed to account for all the places this functionality existed. This means that either new Revisions have been added since you removed them, or not all were removed.') . '

'; + } + } + } } /**