dev/core#2850 add comment
[civicrm-core.git] / CRM / Core / EntityTokens.php
index d879efdc73c711efa3eeea4917acd1b5a6bbe11f..cc9350bb1374a9f9a1021c230b1c2e80d080ac68 100644 (file)
@@ -40,6 +40,10 @@ class CRM_Core_EntityTokens extends AbstractTokenSubscriber {
   public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL) {
     $this->prefetch = (array) $prefetch;
     $fieldValue = $this->getFieldValue($row, $field);
+    if (is_array($fieldValue)) {
+      // eg. role_id for participant would be an array here.
+      $fieldValue = implode(',', $fieldValue);
+    }
 
     if ($this->isPseudoField($field)) {
       if (!empty($fieldValue)) {