Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18148

Geocode provider should not fallback to mapping provider?

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.14, 4.7.3
    • Fix Version/s: 4.7.31
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      In Civi's settings you can choose a 'mapping' provider, but leave a 'geocoding' provider.

      This is desirable if you don't want to geocode addresses.

      However, if a geocoding provider is not set, CiviCRM falls back to using the 'mapping' provider for Geocoding:

        public static function getProviderClass() {
          $settings = Civi::settings();
          if ($settings->get('geoProvider')) {
            return 'CRM_Utils_Geocode_' . $settings->get('geoProvider');
          }
          elseif ($settings->get('mapProvider')) {
            return 'CRM_Utils_Geocode_' . $settings->get('mapProvider');
          }
          else {
            return '';
          }
        }

      This is not the expected behaviour. Admittedly it doesn't make sense to use mapping without geocoding, since you wouldn't have anything to display on the map.

      I could make a quick PR to remove the fallback, or we could change the UI to be clearer that rather than 'setting a geocoding provider' it will use mapping as the default, but can be overridden.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              john John K.
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: