CRM-16099 - friendly error when mapping from profile with no mapping provider configured.
authorDave Greenberg <dave@civicrm.org>
Thu, 19 Mar 2015 16:49:05 +0000 (09:49 -0700)
committerDave Greenberg <dave@civicrm.org>
Thu, 19 Mar 2015 16:49:05 +0000 (09:49 -0700)
----------------------------------------
* 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
CRM/Profile/Page/Listings.php

index 8a051cceb0953bb762d748650fc1dd0c40cfb96d..f68f88bff9f6a11c82035e1760b600d83f7090ce 100644 (file)
@@ -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();
index c52d3a122fb936a7c39af14fa42a6b54479f05b6..01ca927af9548bff2209f945b22955017978f645 100644 (file)
@@ -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');