From 6a6559c2426fd4bced644bed49a890d33794c743 Mon Sep 17 00:00:00 2001 From: "b.endres" Date: Fri, 11 Oct 2024 13:01:10 +0200 Subject: [PATCH 1/2] added warning about switch to APIv4 --- CRM/Moregreetings/Upgrader.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CRM/Moregreetings/Upgrader.php b/CRM/Moregreetings/Upgrader.php index 6d478af..3f27b2b 100644 --- a/CRM/Moregreetings/Upgrader.php +++ b/CRM/Moregreetings/Upgrader.php @@ -43,4 +43,21 @@ public function upgrade_5001() { return TRUE; } + + /** + * Make sure users get a warning about the switch to APIv4 + * + * @return bool TRUE on success + * @throws Exception + */ + public function upgrade_5002() { + CRM_Core_Session::setStatus( + E::ts('MoreGreetings has switched to APIv4, which means that some tokens might not work any more.') . '

' . + E::ts('An example would be the defunct $individual_prefix token, which can be substituted by the $prefix_id:name') . '

'. + E::ts('Make sure you test your greeting templates well before you continue using MoreGreetings.'), + E::ts("Warning"), + 'alert', ['expires' => 0]); + return TRUE; + } + } From 76bffaf6e7bc8f3b762fa31ba90b1b9e4ecd13a9 Mon Sep 17 00:00:00 2001 From: "b.endres" Date: Fri, 11 Oct 2024 13:05:07 +0200 Subject: [PATCH 2/2] correction --- CRM/Moregreetings/Upgrader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Moregreetings/Upgrader.php b/CRM/Moregreetings/Upgrader.php index 3f27b2b..56591b5 100644 --- a/CRM/Moregreetings/Upgrader.php +++ b/CRM/Moregreetings/Upgrader.php @@ -53,7 +53,7 @@ public function upgrade_5001() { public function upgrade_5002() { CRM_Core_Session::setStatus( E::ts('MoreGreetings has switched to APIv4, which means that some tokens might not work any more.') . '

' . - E::ts('An example would be the defunct $individual_prefix token, which can be substituted by the $prefix_id:name') . '

'. + E::ts('An example would be the defunct $individual_prefix token, which can be substituted by the prefix_id:label') . '

'. E::ts('Make sure you test your greeting templates well before you continue using MoreGreetings.'), E::ts("Warning"), 'alert', ['expires' => 0]);