Skip to content

Commit

Permalink
fix infinite loop on Civi 5.44+
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaphoneJon committed Dec 14, 2021
1 parent 84a3b88 commit debed2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion reltoken.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
* implementation of CiviCRM hook
*/
function reltoken_civicrm_tokens(&$tokens) {
static $calledOnce = FALSE;
// Get a list of the standard contact tokens.
// Note that CRM_Core_SelectValues::contactTokens() will invoke this hook again.
$contactTokens = CRM_Core_SelectValues::contactTokens();
$contactTokens = [];
if (!$calledOnce) {
$calledOnce = TRUE;
$contactTokens = CRM_Core_SelectValues::contactTokens();
}
$hashedRelationshipTypes = _reltoken_get_hashed_relationship_types();

// For each standard contact token, create a corresponding token for each
Expand Down

0 comments on commit debed2a

Please sign in to comment.