Index: location.module =================================================================== --- location.module (revision 68) +++ location.module (working copy) @@ -1437,24 +1437,28 @@ $location = $variables['location']; // This will get taken back out if map links are hidden. $location['map_link'] = TRUE; - foreach($variables['hide'] as $key) { - unset($location[$key]); - // Special case for coords. - if ($key == 'coords') { - unset($location['latitude']); - unset($location['longitude']); + if ($variables['hide']) { + foreach($variables['hide'] as $key) { + unset($location[$key]); + // Special case for coords. + if ($key == 'coords') { + unset($location['latitude']); + unset($location['longitude']); + } } } - + $fields = location_field_names(TRUE); - foreach ($fields as $key => $value) { - $variables[$key] = ''; - // Arrays can't be converted, ignore them. - if (!empty($location[$key]) && !is_array($location[$key])) { - $variables[$key] = check_plain($location[$key]); + if ($fields) { + foreach ($fields as $key => $value) { + $variables[$key] = ''; + // Arrays can't be converted, ignore them. + if (!empty($location[$key]) && !is_array($location[$key])) { + $variables[$key] = check_plain($location[$key]); + } } } - + // Location name. $variables['name'] = ''; if (!empty($location['name'])) {