diff --git a/reltoken.php b/reltoken.php index dfc0d64..dc0ee04 100644 --- a/reltoken.php +++ b/reltoken.php @@ -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