From e5e0c47b0e454a248364c83dc176472593ab31df Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Fri, 14 Dec 2018 12:33:03 +0000 Subject: [PATCH] getValue blows up if value is not set, so use getSingle instead --- Civi/Token/TokenRow.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Civi/Token/TokenRow.php b/Civi/Token/TokenRow.php index 4f186d3d5c..efe5275f2a 100644 --- a/Civi/Token/TokenRow.php +++ b/Civi/Token/TokenRow.php @@ -136,10 +136,11 @@ class TokenRow { */ public function customToken($entity, $customFieldID, $entityID) { $customFieldName = "custom_" . $customFieldID; - $fieldValue = civicrm_api3($entity, 'getvalue', array( + $record = civicrm_api3($entity, "getSingle", [ 'return' => $customFieldName, - 'id' => $entityID, - )); + 'id' => $entityID, + ]); + $fieldValue = \CRM_Utils_Array::value($customFieldName, $record, ''); // format the raw custom field value into proper display value if ($fieldValue) { -- 2.25.1