Just upgraded from the last RC to 6.x-3.0. The map link was not showing up no matter what I did.

I traced it down to these lines in location.module


  // Map link.
  $variables['map_link'] = '';

  if (isset($variables['hide']['map_link']) && !$variables['hide']['map_link']) {
    $variables['map_link'] = location_map_link($location);
  }

If variables['hide']['map_link'] is not set, meaning show the map link, then the test is false and the call is to location_map_link is never made.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jriedel’s picture

I just checked something else and the phone information doesn't show up, you have achoice to make it show or not and if I edit the node I see the saved phone information, but you never see it.

jmai’s picture

I changed the if statement to

if (!$variables['hide']['map_link']) {

and it worked.

fletch11’s picture

When I make this substitution I just get the white screen. Does anyone have any more suggestions or a more descriptive example?

thanks

jdm843’s picture

I had this same problem in 5.x-3.0. Fix in #2 worked for me as well.

keyone’s picture

The fix in #2 did nothing for me. I even went so far as to change the code to always call the location_map_link function, and still no map links showing up. I can't see where to fix the phone number problem.

 // Map link.
  //$variables['map_link'] = '';
  //  if (isset($variables['hide']['map_link']) && !$variables['hide']['map_link']) {
 // if (!$variables['hide']['map_link']) {
    $variables['map_link'] = location_map_link($location);
 // }
keyone’s picture

fletch11...You probably left out the other curly bracket. White screen means error. Change it to look like this (I commented out the first if statement, and replaced it with the new one. (this did not work for me, btw)

  // Map link.
  //$variables['map_link'] = '';
  //  if (isset($variables['hide']['map_link']) && !$variables['hide']['map_link']) {
  if (!$variables['hide']['map_link']) {
    $variables['map_link'] = location_map_link($location);
  }
jriedel’s picture

I fixed it for now by commenting out the if and always making the call to location_map_link

keyone’s picture

I did fix this problem using the instructions in Comment #2. One important note. You cannot have the location field "Country Name" hidden in the Content Type > Locative > Display Fields settings, or it won't show map links. That is a requirement of looking up the map. Now, I am trying to debug the phone number problem!

keyone’s picture

Title: Map Link Doesn't show up » Map Link Doesn't show up - phone problem also fixed

I figured out how to fix the phone problem.

In location.tpl.php, near line 28, after this piece of code where it's printing the country...

<?php if ($country_name) { ?>
<div class="country-name"><?php echo $country_name; ?></div>
<?php } ?>

Add this, so it prints out the phone number:

<?php if ($phone) { ?>
<div class="phone"><?php echo $phone; ?></div>
<?php } ?>
SocialNicheGuru’s picture

subscribing.. great fixes

SocialNicheGuru’s picture

Status: Active » Reviewed & tested by the community

This works for 5x.3.0 too.
please commit changes

jriedel’s picture

Don't know if this should be a new issue or not.

I was just starting to set some things up with the user locations. Working OK. Then someone looking over my shoulder said, "You know just a list a can print out of names, addersses and phone numbers would be cool."

I said, "Watch this." as I enabled the user-Location view, but when I went to tweak that view I found out the Phone number field is not in the view. It can not even be picked from one of the location fields.

So somehow when the phone sub-module is enabled, it has to tell views that phone is field it can use.

I started to look a bit at it, but I don't understand the views API at this to even know where to start.

pathfinderelite’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
430 bytes

The missing map link problem exists for the location-5.x-3-0 as well. For me, the patch given in #2 does not work properly, It does show the map link successfully, but the opposite problem now exists. The map link is always shown, despite the display settings. This is because the $variables['hide'] array has numerical indexes, with the values being the name of the field to hide. So, instead of checking if $variables['hide']['map_link'] exists, we need to check if the value 'map_link' is in the array $variables['hide'] - a subtle difference. A patch is attached.

pathfinderelite’s picture

FileSize
436 bytes

If the above patch does not work for you, try this one. I had some issues by not doing a strict in_array comparison in the previous patch. Here is an updated patch.

dustonio’s picture

I applied the patch #14 and it works for me; thanks! I previously was unable to get the "See Map" and the Google Maps link to show until I applied the patch. I am using Drupal 6.9.

rootwork’s picture

Version: 6.x-3.0 » 6.x-3.x-dev

I started with 6.x-3.0 on D6.9. Similar to the original poster I couldn't ever get the map link to appear. Made sure all the permissions were set and a map link provider was checked in location settings.

Then I upgraded to the most recent 6.x-3.x-dev. Still no map link. Tried both of the patches, in #13 and #14, and they don't seem to make a difference, at least for me (I'm jealous of dustonio!). Turned off all caching and cleared stuff just to be sure, each time.

I've actually never seen the map link, so I'm not sure exactly what it's supposed to look like, but there's certainly nothing that would resemble such a thing being displayed.

There's so much that's fantastic about this module, and I love it...but the mythical map link does sound like a nice feature. :)

fletch11’s picture

Hi quixoticlife:

in collection settings of your content type have you allowed the collection of countries? This assumes you are using cck, but the map link does not work if country info is not collected or force defaulted.

rootwork’s picture

Interesting! I figured it wouldn't work if it wasn't collected, but I didn't guess that it would fail with force-default.

Nonetheless, after setting all fields to "Allow," I still don't see a map link. Three of the fields (city, state, country) have defaults -- would that disable the link?

fletch11’s picture

Sorry, I meant to say that it should work if the country field is set to 'force default' but won't if a country is not collected altogether. Can't say I know what would cause this if you've tried setting all fields to 'Allow' and manually entered valid locations in each field. This patch seemed to work for me after trying a lot of things. Have you modified your .tpl.php file for the node type? Also I found that using contemplate required the addition of custom code and that otherwise the link wouldn't show up.

rootwork’s picture

Which patch worked for you, #13 or #14? I haven't created a .tpl.php file for the content type, and node.tpl.php, while slightly modified, is still displaying the straight $content value. I'm not using contemplate.

fletch11’s picture

#14 worked for me... not sure what else to try - you might want to test another theme or disable all unneccessary modules to see if you get a response.

FoolsRun’s picture

I can confirm the phone number display problem, I can also confirm that adding the code from commen #9 fixes it. This should definitely be committed. bdragon?

jriedel’s picture

Can anyone else confirm that the phone number field doesn't show up as a field to choose in Views?

Try creating a new view and phone number is not listed to pick from to display.

KarenS’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #14 makes the map link show up. I don't use the phone number so can't confirm anything about that. If this doesn't fix the phone number, I think that is a separate issue, because the failure of the map link to display is clearly the incorrect logic that is fixed by #14.

bdragon’s picture

Confirmed #14 patch.

Committed something a bit different, because I figure it will be slightly more efficient than in_array.

http://drupal.org/cvs?commit=170589
http://drupal.org/cvs?commit=170591
http://drupal.org/cvs?commit=170593

bdragon’s picture

FileSize
634 bytes

Regarding the phone problem, I've been running with this patch for a while. Does anyone have any +1s or -1s for it?

skyredwang’s picture

#26 would be better if using instead of

. Just for consistency.
davea’s picture

#14 works so now the Google maps links displays.

Thanks!
DaveA

drizzi’s picture

still have the same effect.. updated to the last dev and even have problems to find the equivalent program code in order to change.

is there any better explanation available or will the downloadable code updated soon ? i urgently need the location including a functional gmap.

the phone and fax stuff is working; the map shows up while editing and disappears while in "normal" homepage made.

any quick help is appriciated.

steffen

edit: found "Then, make sure permissions on "files," "files/js" and "files/js/gmap_markers.js" are set to 777 - that's working for me - so far, anyway." this solved my problem.

Matt V.’s picture

The patch in #26 works, but could use a bit of formatting cleanup. There is no space between the field label and the field.

AaronBauman’s picture

Status: Reviewed & tested by the community » Needs work

Map Link disappears from display when "Country" (not to be confused with "Country Name") checkbox is checked.

Appears fine if "Country" checkbox (and "Map Link" checkbox) is left unchecked.

seanr’s picture

Confirmed #31. Definitely something screwy with these checkboxes. I'd bet it's just a typo somewhere.

YesCT’s picture

seanr’s picture

Same bug exists in 5.x

Macronomicus’s picture

I can confirm that the dev version fixes the issue.
For some reason the last time I ran drush updates it installed the 3.0 version. Should that one really be the recommended version with all those bugs? At any rate I am sooo excited that the dev version is a happy camper! Thanks for the fixes!

YesCT’s picture

Status: Needs work » Fixed
YesCT’s picture

Issue tags: +location bdragon check

Hmmm was the patch in #26 included in the dev release?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dhartman’s picture

Status: Closed (fixed) » Active

Patch in #26 doesn't appear to be committed in 6.x-3.x-dev. Also, I can confirm that the bug in #31 still exists in dev from today (6-12-2009).

seanr’s picture

Same. Can we please get this in an RC release too?

sandino’s picture

Status: Needs work » Active

Applied patch #26 and it works for me with 3.1-rc1.

YesCT’s picture

Status: Active » Needs work
YesCT’s picture

Status: Active » Needs work

@skyredwang in #27 I think you posted some HTML we can't see. Please repost.

Formatting mentioned in #30

and

Checkbox problem in #31

Need addressed.

Someone needs to address those and re-roll this againt head.

The cvs checkout command is on the location project page [edit: http://drupal.org/project/location] under a deveopler tab [edit: it's actually called CVS Instructions]. And google for:
drupal apply patch
and
drupal create patch
if you (someone) wants to take a stab at this.

If anyone needs help making the re-roll patch post back here or try #drupal-geo for help on irc

bomarmonk’s picture

Has this fix been committed? No map links display for me.

skyredwang’s picture

Status: Needs work » Fixed

Yes. the fix has been committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

woodhous@email.unc.edu’s picture

I am running location -6.x-3.1-r1 module

re: map_link

I am allowing collection of all fields and there is data entered for name, street, city, province, state and country. If I display all the fields (in other words I do not hide anything) the map link shows up fine. But that is not what I want to do. I only want to display the map link. The data is all collected, I just don't want to display all of it. When I check to Display in full text and uncheck all but the map link, the map link is not displayed.

re: phone number

I do not have an option to collect phone number.

Thanks!
Diana