Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#26 | location.tpl_.php_.patch | 634 bytes | bdragon |
#14 | location-346694-14.patch | 436 bytes | pathfinderelite |
#13 | location-346694-13.patch | 430 bytes | pathfinderelite |
Comments
Comment #1
jriedel CreditAttribution: jriedel commentedI 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.
Comment #2
jmai CreditAttribution: jmai commentedI changed the if statement to
and it worked.
Comment #3
fletch11 CreditAttribution: fletch11 commentedWhen I make this substitution I just get the white screen. Does anyone have any more suggestions or a more descriptive example?
thanks
Comment #4
jdm843 CreditAttribution: jdm843 commentedI had this same problem in 5.x-3.0. Fix in #2 worked for me as well.
Comment #5
keyone CreditAttribution: keyone commentedThe 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.
Comment #6
keyone CreditAttribution: keyone commentedfletch11...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)
Comment #7
jriedel CreditAttribution: jriedel commentedI fixed it for now by commenting out the if and always making the call to location_map_link
Comment #8
keyone CreditAttribution: keyone commentedI 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!
Comment #9
keyone CreditAttribution: keyone commentedI 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...
Add this, so it prints out the phone number:
Comment #10
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedsubscribing.. great fixes
Comment #11
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis works for 5x.3.0 too.
please commit changes
Comment #12
jriedel CreditAttribution: jriedel commentedDon'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.
Comment #13
pathfinderelite CreditAttribution: pathfinderelite commentedThe 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.
Comment #14
pathfinderelite CreditAttribution: pathfinderelite commentedIf 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.
Comment #15
dustonio CreditAttribution: dustonio commentedI 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.
Comment #16
rootworkI 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. :)
Comment #17
fletch11 CreditAttribution: fletch11 commentedHi 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.
Comment #18
rootworkInteresting! 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?
Comment #19
fletch11 CreditAttribution: fletch11 commentedSorry, 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.
Comment #20
rootworkWhich 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.
Comment #21
fletch11 CreditAttribution: fletch11 commented#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.
Comment #22
FoolsRun CreditAttribution: FoolsRun commentedI 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?
Comment #23
jriedel CreditAttribution: jriedel commentedCan 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.
Comment #24
KarenS CreditAttribution: KarenS commentedThe 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.
Comment #25
bdragon CreditAttribution: bdragon commentedConfirmed #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
Comment #26
bdragon CreditAttribution: bdragon commentedRegarding the phone problem, I've been running with this patch for a while. Does anyone have any +1s or -1s for it?
Comment #27
skyredwang#26 would be better if using instead of
Comment #28
davea CreditAttribution: davea commented#14 works so now the Google maps links displays.
Thanks!
DaveA
Comment #29
drizzi CreditAttribution: drizzi commentedstill 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.
Comment #30
Matt V. CreditAttribution: Matt V. commentedThe patch in #26 works, but could use a bit of formatting cleanup. There is no space between the field label and the field.
Comment #31
AaronBaumanMap 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.
Comment #32
seanrConfirmed #31. Definitely something screwy with these checkboxes. I'd bet it's just a typo somewhere.
Comment #33
YesCT CreditAttribution: YesCT commentedduplicate? #387198: No Phone Field in User Accounts
Comment #34
seanrSame bug exists in 5.x
Comment #35
Macronomicus CreditAttribution: Macronomicus commentedI 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!
Comment #36
YesCT CreditAttribution: YesCT commentedComment #37
YesCT CreditAttribution: YesCT commentedHmmm was the patch in #26 included in the dev release?
Comment #39
dhartman CreditAttribution: dhartman commentedPatch 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).
Comment #40
seanrSame. Can we please get this in an RC release too?
Comment #41
sandino CreditAttribution: sandino commentedApplied patch #26 and it works for me with 3.1-rc1.
Comment #42
YesCT CreditAttribution: YesCT commentedComment #43
YesCT CreditAttribution: YesCT commented@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
Comment #44
bomarmonk CreditAttribution: bomarmonk commentedHas this fix been committed? No map links display for me.
Comment #45
skyredwangYes. the fix has been committed.
Comment #47
woodhous@email.unc.edu CreditAttribution: woodhous@email.unc.edu commentedI 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