From: eileen Date: Thu, 29 Aug 2013 02:51:34 +0000 (+1200) Subject: CRM-13296 deal with possibility minimum_fee is NULL X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6a111039fa3e647e98695cf26d6f829160b6de1b;p=civicrm-core.git CRM-13296 deal with possibility minimum_fee is NULL --- 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])) {