unrelated e-notice fixes
authoreileen <eileen@fuzion.co.nz>
Tue, 6 Aug 2013 21:19:34 +0000 (09:19 +1200)
committereileen <eileen@fuzion.co.nz>
Tue, 6 Aug 2013 21:19:34 +0000 (09:19 +1200)
CRM/Core/Page/AJAX/Location.php

index 9ddaa3edb3030fb8fc49ac7fda3a0311b6bd0828..c07013f02b042542ec08bd753b710bf44335e67b 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Core_Page_AJAX_Location {
     $addressSequence = array_flip($config->addressSequence());
 
 
-    if ($relContact) {
+    if (!empty($relContact)) {
       $elements = array(
         "phone_1_phone" =>
         $location['phone'][1]['phone'],
@@ -147,7 +147,7 @@ class CRM_Core_Page_AJAX_Location {
         }
       }
 
-      $locTypeId = $location['address'][1]['location_type_id'];
+      $locTypeId = isset($location['address'][1]) ? $location['address'][1]['location_type_id'] : NULL;
       $addressFields = array(
         'street_address',
         'supplemental_address_1',
@@ -167,7 +167,7 @@ class CRM_Core_Page_AJAX_Location {
           }
           $elements["onbehalf_{$field}-{$locTypeId}"] = array(
             'type' => 'Text',
-            'value' => $location['address'][1][$addField],
+            'value' =>  isset($location['address'][1]) ? $location['address'][1][$addField] : null,
           );
           unset($profileFields["{$field}-{$locTypeId}"]);
         }