From: Tim Otten Date: Wed, 1 Feb 2023 06:00:39 +0000 (-0800) Subject: CRM_Upgrade_Headless - The pre-up and post-up msgs should have same formatting X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f9d5683cdf9b0852f450d9c3c6cfd12eb137f046;p=civicrm-core.git CRM_Upgrade_Headless - The pre-up and post-up msgs should have same formatting --- diff --git a/CRM/Upgrade/Headless.php b/CRM/Upgrade/Headless.php index 674a334e55..e75be07d1e 100644 --- a/CRM/Upgrade/Headless.php +++ b/CRM/Upgrade/Headless.php @@ -17,6 +17,7 @@ class CRM_Upgrade_Headless { /** * Pre Upgrade Message * @var string + * HTML-formatted message */ private $preUpgradeMessage; @@ -77,11 +78,14 @@ class CRM_Upgrade_Headless { } /** - * Get the PreUpgrade message - * @return string + * Get the pre-upgrade message. + * + * @return array + * The upgrade message, in HTML and text formats. + * Ex: ['message' => '

Foo

Bar

', 'text' => ["Foo\n\nBar"]] * @throws \Exception */ - public function getPreUpgradeMessage(): string { + public function getPreUpgradeMessage(): array { $upgrade = new CRM_Upgrade_Form(); [$currentVer, $latestVer] = $upgrade->getUpgradeVersions(); @@ -94,7 +98,10 @@ class CRM_Upgrade_Headless { $upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer); $this->preUpgradeMessage = $preUpgradeMessage; } - return $this->preUpgradeMessage; + return [ + 'message' => $this->preUpgradeMessage, + 'text' => CRM_Utils_String::htmlToText($this->preUpgradeMessage), + ]; } }