Add preUpgrade message
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 30 Jan 2023 01:04:26 +0000 (14:04 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 30 Jan 2023 21:44:22 +0000 (10:44 +1300)
CRM/Upgrade/Incremental/php/FiveFiftyNine.php

index f0573ceecc161a3d2ed9ee6691b1a09050da62de..c5250703cb0a58054b143869d5bf16bfd751b6e2 100644 (file)
  */
 class CRM_Upgrade_Incremental_php_FiveFiftyNine extends CRM_Upgrade_Incremental_Base {
 
+  public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL): void {
+    if ($rev === '5.59.alpha1') {
+      if (empty(CRM_Core_Config::singleton()->userSystem->is_wordpress)) {
+        $preUpgradeMessage .= '<p>' . ts('The handling of invalid smarty template code in mailings, reminders and other automated messages has changed . For details, see <a %1>upgrade notes</a>.',
+            [1 => 'href="https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-559" target="_blank"']) . '</p>';
+      }
+    }
+  }
+
   /**
    * Upgrade step; adds tasks including 'runSql'.
    *
    * @param string $rev
    *   The version number matching this function name
    */
-  public function upgrade_5_59_alpha1($rev): void {
+  public function upgrade_5_59_alpha1(string $rev): void {
     $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
     $this->addTask('Drop column civicrm_custom_field.mask', 'dropColumn', 'civicrm_custom_field', 'mask');
   }