From 45d978344c81a41e698783de8a65d17f66f662d2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 7 Jan 2021 21:18:01 -0800 Subject: [PATCH] FiveThirtyFour - DRY message. Tweak prose. --- .../Incremental/php/FiveThirtyFour.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FiveThirtyFour.php b/CRM/Upgrade/Incremental/php/FiveThirtyFour.php index b95d5b7348..b5181fe506 100644 --- a/CRM/Upgrade/Incremental/php/FiveThirtyFour.php +++ b/CRM/Upgrade/Incremental/php/FiveThirtyFour.php @@ -29,9 +29,7 @@ class CRM_Upgrade_Incremental_php_FiveThirtyFour extends CRM_Upgrade_Incremental $xoauth2Value = CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_MailSettings', 'protocol', 'IMAP_XOAUTH2'); if (!empty($xoauth2Value)) { if ($this->isXOAUTH2InUse($xoauth2Value)) { - // Leaving out ts() since it's unlikely this message will ever - // be displayed to anyone. - $preUpgradeMessage .= '

This site appears to be using the IMAP_XOAUTH2 mail protocol which was part of pre-5.32 work towards OAUTH2 but was never functional and never released as an active option value. Please post at https://lab.civicrm.org/dev/core/-/issues/2264 describing how you are using this value.

'; + $preUpgradeMessage .= '

' . $this->getXOAuth2Warning() . '

'; } } } @@ -50,9 +48,7 @@ class CRM_Upgrade_Incremental_php_FiveThirtyFour extends CRM_Upgrade_Incremental $xoauth2Value = CRM_Core_PseudoConstant::getKey('CRM_Core_BAO_MailSettings', 'protocol', 'IMAP_XOAUTH2'); if (!empty($xoauth2Value)) { if ($this->isXOAUTH2InUse($xoauth2Value)) { - // Leaving out ts() since it's unlikely this message will ever - // be displayed to anyone. - $postUpgradeMessage .= '
'; + $postUpgradeMessage .= '
'; } } } @@ -180,4 +176,18 @@ WHERE ov.value = %1", return $enabled || $usedInMailSettings; } + /** + * @return string + */ + private function getXOAuth2Warning():string { + // Leaving out ts() since it's unlikely this message will ever + // be displayed to anyone. + return strtr( + 'This system has enabled "IMAP_XOAUTH2" which was experimentally declared in CiviCRM v5.24. CiviCRM v5.33+ includes a supported replacement ("oauth-client"), and the experimental "IMAP_XOAUTH2" should be removed. Please visit %1 to discuss.', + [ + '%1' => 'dev/core#2264', + ] + ); + } + } -- 2.25.1