Merge pull request #21494 from eileenmcnaughton/compat
authorTim Otten <totten@civicrm.org>
Tue, 21 Sep 2021 10:09:11 +0000 (03:09 -0700)
committerGitHub <noreply@github.com>
Tue, 21 Sep 2021 10:09:11 +0000 (03:09 -0700)
dev/core#2814 TokenCompatSubscriber - evaluate contact tokens during civi.token.eval phase

CRM/Event/Tokens.php
CRM/Report/Form.php

index 54189d30eb285086ed6a5388b3935b70f75a98be..5de70c3080bf9616a4c5b00009e6994a31e765c0 100644 (file)
@@ -141,7 +141,7 @@ LEFT JOIN civicrm_phone phone ON phone.id = lb.phone_id
       $row->tokens($entity, $field, $actionSearchResult->$field);
     }
     elseif ($cfID = \CRM_Core_BAO_CustomField::getKeyID($field)) {
-      $row->customToken($entity, $cfID, $actionSearchResult->entity_id);
+      $row->customToken($entity, $cfID, $actionSearchResult->event_id);
     }
     else {
       $row->tokens($entity, $field, '');
index 352bbf35eccf2cf47ccf7b57aff3f846c51dceaa..da4e6ba09d07968ffef4655648fdf6cdd931e13a 100644 (file)
@@ -626,6 +626,10 @@ class CRM_Report_Form extends CRM_Core_Form {
 
       // set qfkey so that pager picks it up and use it in the "Next > Last >>" links.
       // FIXME: Note setting it in $_GET doesn't work, since pager generates link based on QUERY_STRING
+      if (!isset($_SERVER['QUERY_STRING'])) {
+        // in php 7.4 can do this with less lines with ??=
+        $_SERVER['QUERY_STRING'] = '';
+      }
       $_SERVER['QUERY_STRING'] .= "&qfKey={$this->controller->_key}";
     }