From f9d5683cdf9b0852f450d9c3c6cfd12eb137f046 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 31 Jan 2023 22:00:39 -0800 Subject: [PATCH] CRM_Upgrade_Headless - The pre-up and post-up msgs should have same formatting --- CRM/Upgrade/Headless.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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), + ]; } } -- 2.25.1