As an offshoot of the solution to the problem in #346694: Map Link Doesn't show up - phone problem also fixed, I found another issue.

In template_preprocess_location, if country is in the list of hidden fields, it will be removed from $location, causing the map link generation to bail out due to this part:

if (!isset($location['country']) && $location['country'] != 'xx') {
    return '';
} 

A simple workaround is to use $variables['location'] instead when generating the map link. I've created a patch for this change.

CommentFileSizeAuthor
location.module.patch590 bytesmikl

Comments

mikl’s picture

By the way, shouldn't

if (!isset($location['country']) && $location['country'] != 'xx') {
    return '';
} 

be changed to

if (!isset($location['country']) || $location['country'] == 'xx') {
    return '';
} 

(location.inc, line ~40)

yesct’s picture

Title: Map link not working when country is hidden » Map link not working when country is hidden (patch included, change to patch needs feedback)

This needs someone to try it out. And after the question in #1 is answered, a new patch against dev is needed.

dww’s picture