CMS MADE SIMPLE FORGE

Company Directory

 

[#6198] CompanyDirectory doesnt use the correct array when retrieving lat/long from Postcoide

avatar
Created By: Kim Roper Jensen (kiroje)
Date Submitted: Fri Mar 04 03:30:33 -0500 2011

Assigned To: Robert Campbell (calguy1000)
Version: 1.8
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
CompanyDirectory doesnt use the correct array when retrieving lat/long from Postcoide
Detailed Description:
in action.do_search.php this function :'

// if we can find the Postcode module now we can find a base latitude and
longitude.
if( empty($errors) && !$have_latlong && !empty($postal) && $postcode &&
$do_zip_search  )
      {
		$postal_data = $postcode->Lookup_Zip($country,$postal,$postalchars);
		if( !is_array($postal_data) && !$search_address )
		  {
			// it didn't work
			$errors[] = $this->Lang('error_postcode_lookup',$postal);
		  }
		$latitude = $postal['latitude'];
		$longitude = $postal['longtitude'];
		$have_latlong = 1;
      }

should be changed to 

// if we can find the Postcode module now we can find a base latitude and
longitude.
if( empty($errors) && !$have_latlong && !empty($postal) && $postcode &&
$do_zip_search  )
      {
		$postal_data = $postcode->Lookup_Zip($country,$postal,$postalchars);
		if( !is_array($postal_data) && !$search_address )
		  {
			// it didn't work
			$errors[] = $this->Lang('error_postcode_lookup',$postal);
		  }
		$latitude = $postal_data['latitude'];
		$longitude = $postal_data['longitude'];
		$have_latlong = 1;
      }

so postal[] is changed to postal_data[] and the index logtitude is changed to
longitude.


History

Comments
avatar
Date: 2011-03-04 03:51
Posted By: Kim Roper Jensen (kiroje)

the diff here 

--- C:/Users/kim/Downloads/CompanyDirectory-1.8 -
Kopi/CompanyDirectory/action.do_search.php	Fri Mar 04 09:41:18 2011
+++
C:/Users/kim/Downloads/CompanyDirectory-1.8/CompanyDirectory/action.do_search.php
Sat Jan 29 06:50:43 2011
@@ -321,8 +321,8 @@
 			// it didn't work
 			$errors[] = $this->Lang('error_postcode_lookup',$postal);
 		  }
-		$latitude = $postal['latitude'];
-		$longitude = $postal['longtitude'];
+		$latitude = $postal_data['latitude'];
+		$longitude = $postal_data['longitude'];

 		$have_latlong = 1;
       }
 

      
Updates

Updated: 2011-12-22 22:38
cmsms_version_id: => -1
state: Open => Closed

Updated: 2011-03-25 14:17
resolution_id: 5 => 7

Updated: 2011-03-04 03:53
description: in action.do_search.php this function :' // if we can find the Postcode module now we can find a base latitude and longitude. if( empty($errors) && !$have_latlong && !empty($postal) && $postcode && $do_zip_search ) { $postal_data = => in action.do_search.php this function :' // if we can find the Postcode module now we can find a base latitude and longitude. if( empty($errors) && !$have_latlong && !empty($postal) && $postcode && $do_zip_search ) { $postal_data =

Updated: 2011-03-04 03:51
resolution_id: => 5