Commit 8e98ecb4 authored by rajeshs's avatar rajeshs
Browse files

Display API errors during postcode lookup

parent 6c8737ee
......@@ -56,7 +56,12 @@ class CRM_Civicrmpostcodelookup_Page_Civipostcode extends CRM_Core_Page {
$simpleJSONData = json_decode($data);
if (!empty($simpleJSONData)) {
$addresslist = self::getAddressList($simpleJSONData, $postcode);
if ($simpleJSONData->is_error == 1) {
$addresslist[0]['value'] = '';
$addresslist[0]['label'] = $simpleJSONData->error;
} else {
$addresslist = self::getAddressList($simpleJSONData, $postcode);
}
}
// highlight search results
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment