Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about APIv4 switch #49

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CRM/Moregreetings/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.') . '<br/><br/>' .
E::ts('An example would be the defunct <code>$individual_prefix</code> token, which can be substituted by the <code>prefix_id:label</code>') . '<br/><br/>'.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be contact.individual_prefix token (without the $), no …?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't configured this in a while, but I think its SMARTY tokens, not regular ones - see the examples

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right. We really should stop calling Smarty variables Tokens, this has always been so confusing …

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

}
Loading