Good morning everyone,
I'm working on developing some integration between the smartIP's geolocation tool for anonymous users, and location's functionality. My goal is to pass a "faked" location from the anonymous user to the correct data fields in their anonymous user object so other modules can better rely on user locations.
The snag where I could use a hand is the existence of user location data. If I do a user_load, location information comes in just fine. But if I dump the global $user object, no location information exists. I'm testing with the same account for both methods, uid=1.
Was there a decision made to not load location information into the $user object, or am I just missing it somehow? If not, is this something you would like a patch to ensure it exists?
Comments
Comment #1
lance.gliser commentedChanged the version, sorry about that.
Comment #2
lance.gliser commentedDid more digging on my own, and it seems like this a Drupal core issue, not a location issue. http://api.drupal.org/api/drupal/developer--globals.php/global/user/6
Which then leads me to wonder what the best way to pass the faked locations to anonymous users would be, since my original plan failed. Would you prefer I use location_invoke_locationapi to alter the location? Will it even get that far? Would it be better to put in another invoke, or integration line in the user_load to try a smartIP load if no user locations are defined?
Comment #3
hutch commentedDon't know if this helps, but in my Getdirections module I use
Comment #4
lance.gliser commentedThat's an elegant way to load it, for sure. Not exactly what I'm suggesting though.
Right now the location_user.module fires location_user_user, which is a closed system. It runs location_load_locations, which can not be interacted with, then returns.
What would really help out my work, and the community as well I think. Would be a hook somewhere in that process where other modules could provide or alter location information. In my case, I would want the option of something like _invoke_all('user_locations', $user->locations). This would allow me to provide a best guess location to all modules that can use user locations, through geotargeting provided by smartIP.
Comment #5
arpeggio commentedSubscribing.
Comment #6
legolasboClosing old D6 issues as D6 is end of life