From c3c3e099d03d4794e5028b06a57137d39906b606 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 19 Mar 2015 09:49:05 -0700 Subject: [PATCH] CRM-16099 - friendly error when mapping from profile with no mapping provider configured. ---------------------------------------- * CRM-16099: Map Profile Results Smarty error when no mapping provider is configured AND strict warning in 4.6 on mapping page https://issues.civicrm.org/jira/browse/CRM-16099 --- CRM/Contact/Form/Task/Map.php | 3 +++ CRM/Profile/Page/Listings.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Task/Map.php b/CRM/Contact/Form/Task/Map.php index 8a051cceb0..f68f88bff9 100644 --- a/CRM/Contact/Form/Task/Map.php +++ b/CRM/Contact/Form/Task/Map.php @@ -176,6 +176,9 @@ class CRM_Contact_Form_Task_Map extends CRM_Contact_Form_Task { CRM_Core_Error::statusBounce(ts('This address does not contain latitude/longitude information and cannot be mapped.')); } + if (empty($config->mapProvider)) { + CRM_Core_Error::statusBounce(ts('You need to configure a Mapping Provider before using this feature (Administer > System Settings > Mapping and Geocoding).')); + } if ($addBreadCrumb) { $session = CRM_Core_Session::singleton(); $redirect = $session->readUserContext(); diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index c52d3a122f..01ca927af9 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -409,7 +409,7 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { * * @return array */ - public function getProfileContact($gid) { + public static function getProfileContact($gid) { $session = CRM_Core_Session::singleton(); $params = $session->get('profileParams'); -- 2.25.1