All Location Fields Don't Appear when Using Node Import Module
mlondon77 - August 19, 2008 - 02:36
| Project: | Location |
| Version: | 5.x-3.0 |
| Component: | Miscellaneous |
| Category: | task |
| Priority: | normal |
| Assigned: | bdragon |
| Status: | duplicate |
| Issue tags: | location compatibility with other modules, location importing |
Description
I'm trying to use node import to import a CSV file; however, not all the location fields appear in the drop down box when i try to map the file. The only location fields which appear are Country, Longitude, and Latitude. My file contains company name, address, city, state, zip, and phone.
Has anyone else experienced this problem? Does anyone have any advice for me?
Thanks in advance! I'd appreciate any help.

#1
It seems that node_import doesn't know about the Location 3.x changes yet.
I'll cook up a patch.
#2
Here's a minimally tested (for lack of sample data) patch that should hopefully have cross-compatibility with all versions of Location.
#3
And for those unable to patch, a drop in .inc file, suitable for use with a DRUPAL-5 checkout or whatever the latest 5.x release is. (I patched against DRUPAL-5.)
#4
(try 2)
#5
Thanks for the response.
I'm relatively new to drupal. I can't apply a patch because I'm on a shared server. If I wanted to go the route of the .inc file, how would I apply it?
Thanks.
#6
mlondon77: Copy the
location.inc_.txtfile (comment #4) intosites/all/modules/node_import/supported(or whereever you install your contrib modules) renaming it tolocation.inc. There should be alocation.incin that directory already.Can you then tell whether the new files works like expected?
#7
Dude!!! You're awesome! Thanks so much!! I tried it with some test files and it mostly worked.
One thing: in the drop down box, there is one field named "Location: ". I assume this is location name; however, when I use this field for the location name, it doesn't import anything. Any ideas?
Thanks again so much. This is really helpful.
#8
Subscribing. Also going to test this patch against 5.x-3.0-RC1. Note that http://drupal.org/node/307677 is a dupe under node_import issues queue.
#9
Thanks! Patch #4 works for me with node_import 1.9, location rc2 and drupal 5.10.
As opposed to #7, I have a Location: location name available during the import and can import into it.
#10
#4
Location:Latitude and Location:Longitude field is not imported.
#11
Will the above patch work on the latest version(s)?
Location 5.x-3.0-rc2
Node import 5.x-1.9
Only my location.inc is now in sites/all/modules/location/location.inc not in sites/all/modules/location/supported/location.inc and if you replace one with t'other then you get a fatal error?
#12
This patch for file sites/all/modules/node_import/supported/location.inc
#13
...and that will have been my 'fatal' mistake. I spent hours on that, all because I didn't read it properly.
Thank you very much for your prompt help
#14
In response to #10
Actually I've discover this has something to do with the (location_geo_logic function in the location.module). This funcion allways sets lat and long to 0. To avoid that just edit the location.module and replace (line 1569 aprox.)
function _location_geo_logic(&$location, $changed, $filled, $inhibit_geocode = FALSE) {
if (!$inhibit_geocode) {
with:
function _location_geo_logic(&$location, $changed, $filled, $inhibit_geocode = FALSE) {
if (!$inhibit_geocode && !($location['latitude']!=0&&$location['longitude']!=0)) { //emlomar1
hope this helps.
#15
Having had this work with the location.inc from #2
and then updated today with location 5.x-3.0 (http://drupal.org/node/346395) the node import is not displaying all the location fields again
Also posted at http://drupal.org/node/307677#comment-1161336
#16
emlomar1 - your 2 lines of code fixed an issue that has been driving me nuts for 2 days. Thank you.
#17
As per #15, the location.inc patch does not work with Location 5.x-3.0.
#18
subscribing.
#19
Drupal 5.15, Node Import 5.x-1.9, Location 5.x-3.0, also tried http://drupal.org/node/307677 where the fields show up, but data is NOT imported.
Having tried #4 of this post: Location:country no longer shows up, only long/lattitude. Other location fields are NOT availabe, see #17.
HELP..!
#20
I'm having the same issues as #19. Fields not showing up. I did apply the patch from #1 in http://drupal.org/node/307677 and I was able to get the fields to show up but they would not import. I got errors about invalid state / province...
Tried both location and the location dev version. Using 5.15 drupal, latest CCK and latest node import...
#21
It seems the other issue might have more recent information...
marking this one as a duplicate of #307677: Location Fields not showing up (need updated patch for import with Node Import Module to Location Module 5.x)
Also, tagging.
#22
tagging.