Merge pull request #8861 from danbrellis/patch-1
[civicrm-core.git] / Civi / Token / TokenCompatSubscriber.php
index 104d9f1117c51ac25e382a1cdc10c643eaff231f..3eaf57d3b7cc6ac6d92ccf948c9647a45825767b 100644 (file)
@@ -83,6 +83,10 @@ class TokenCompatSubscriber implements EventSubscriberInterface {
         $row->context['controller']
       );
 
+      // merge the custom tokens in the $contact array
+      if (!empty($contactArray[$contactId])) {
+        $contact = array_merge($contact, $contactArray[$contactId]);
+      }
       $row->context('contact', $contact);
     }
   }