From 6a111039fa3e647e98695cf26d6f829160b6de1b Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 29 Aug 2013 14:51:34 +1200 Subject: [PATCH] CRM-13296 deal with possibility minimum_fee is NULL --- CRM/Utils/Token.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 73ce56a018..f5a3985f83 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1411,7 +1411,14 @@ class CRM_Utils_Token { $value = $statuses[$membership['status_id']]; break; case 'fee': - $value = civicrm_api3('membership_type', 'getvalue', array('id' => $membership['membership_type_id'], 'return' => 'minimum_fee')); + try{ + $value = civicrm_api3('membership_type', 'getvalue', array('id' => $membership['membership_type_id'], 'return' => 'minimum_fee')); + } + catch (CiviCRM_API3_Exception $e) { + // we can anticipate we will get an error if the minimum fee is set to 'NULL' because of the way the + // api handles NULL (4.4) + $value = 0; + } break; default: if (in_array($token, self::$_tokens[$entity])) { -- 2.25.1