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

contact import fails when zip code is blank

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      CRM/Utils/Geocode/ZipTable.php throws an error during contact import when zip code is blank.

      I fixed the problem by avoiding the coordinate lookup if zip code is blank:

      $zip = addslashes( $values['postal_code'] );
      if ( $zip !== '' ) {
      $query = 'SELECT latitude, longitude FROM zipcodes WHERE zip = ' . addslashes( $values['postal_code'] );
      $dao =& CRM_Core_DAO::executeQuery( $query );
      if ( $dao->fetch( ) )

      { $values['geo_code_1'] = $dao->latitude ; $values['geo_code_2'] = $dao->longitude; return true; }

      }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              Anonymous
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: