dev/core#3805 Fix handling of minimum_fee token when not set
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 18 May 2023 23:44:35 +0000 (11:44 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 18 May 2023 23:44:35 +0000 (11:44 +1200)
CRM/Member/Tokens.php

index 6f78449b48f992319308ada9f9e893b7c9f8a91d..a7549ee796e3b74a2d536e1a9ebc7bc4f7be0394 100644 (file)
@@ -64,7 +64,7 @@ class CRM_Member_Tokens extends CRM_Core_EntityTokens {
   public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) {
     if ($field === 'fee') {
       $membershipType = CRM_Member_BAO_MembershipType::getMembershipType($this->getFieldValue($row, 'membership_type_id'));
-      $row->tokens($entity, $field, \CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($membershipType['minimum_fee']));
+      $row->tokens($entity, $field, \CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($membershipType['minimum_fee'] ?? 0));
     }
     else {
       parent::evaluateToken($row, $entity, $field, $prefetch);