From a21aaa6a960344513eaab85477852967b4f16846 Mon Sep 17 00:00:00 2001 From: scardinius Date: Mon, 13 Jun 2016 16:13:35 +0200 Subject: [PATCH] CRM-18815: getTrackerURL() returns invalid url_id for CiviMail A/B Test --- CRM/Mailing/BAO/TrackableURL.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Mailing/BAO/TrackableURL.php b/CRM/Mailing/BAO/TrackableURL.php index a7e6b4b841..bda2fe97c6 100644 --- a/CRM/Mailing/BAO/TrackableURL.php +++ b/CRM/Mailing/BAO/TrackableURL.php @@ -57,8 +57,8 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL { static $urlCache = array(); - if (array_key_exists($url, $urlCache)) { - return $urlCache[$url] . "&qid=$queue_id"; + if (array_key_exists($mailing_id.$url, $urlCache)) { + return $urlCache[$mailing_id.$url] . "&qid=$queue_id"; } // hack for basic CRM-1014 and CRM-1151 and CRM-3492 compliance: @@ -93,10 +93,10 @@ class CRM_Mailing_BAO_TrackableURL extends CRM_Mailing_DAO_TrackableURL { $tracker->free(); $redirect = $config->userFrameworkResourceURL . "extern/url.php?u=$id"; - $urlCache[$url] = $redirect; + $urlCache[$mailing_id.$url] = $redirect; } - $returnUrl = "{$urlCache[$url]}&qid={$queue_id}"; + $returnUrl = "{$urlCache[$mailing_id.$url]}&qid={$queue_id}"; if ($hrefExists) { $returnUrl = "href='{$returnUrl}'"; -- 2.25.1