From 3fefc0e768abf5e9b03d6b70b41082e408b6e2af Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Sat, 22 Feb 2014 18:35:45 -0800 Subject: [PATCH] CRM-14249 - fix fatal error when anonymous user accesses civicrm/mailing/view. ---------------------------------------- * CRM-14249: Can't view public mailings when logged out http://issues.civicrm.org/jira/browse/CRM-14249 --- CRM/Mailing/BAO/Mailing.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index c9571bf28b..fe6ce08e81 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -1110,6 +1110,11 @@ ORDER BY civicrm_email.is_bulkmail DESC if ($contactDetails) { $contact = $contactDetails; } + elseif ($contactId === 0) { + //anonymous user + $contact = array(); + CRM_Utils_Hook::tokenValues($contact, $contactId, $job_id); + } else { $params = array(array('contact_id', '=', $contactId, 0, 0)); list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($params); -- 2.25.1