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.

CommentFileSizeAuthor
#4 location.inc_.txt7.15 KBbdragon
#2 location.inc_.patch3.67 KBbdragon

Comments

bdragon’s picture

Assigned: Unassigned » bdragon
Category: bug » task

It seems that node_import doesn't know about the Location 3.x changes yet.

I'll cook up a patch.

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

Here's a minimally tested (for lack of sample data) patch that should hopefully have cross-compatibility with all versions of Location.

bdragon’s picture

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.)

bdragon’s picture

StatusFileSize
new7.15 KB

(try 2)

mlondon77’s picture

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.

Robrecht Jacques’s picture

mlondon77: Copy the location.inc_.txt file (comment #4) into sites/all/modules/node_import/supported (or whereever you install your contrib modules) renaming it to location.inc. There should be a location.inc in that directory already.

Can you then tell whether the new files works like expected?

mlondon77’s picture

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.

DanielJohnston’s picture

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.

hansrossel’s picture

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.

scandi’s picture

#4
Location:Latitude and Location:Longitude field is not imported.

uksigma’s picture

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?

scandi’s picture

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?

This patch for file sites/all/modules/node_import/supported/location.inc

uksigma’s picture

...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

emlomar1’s picture

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.

uksigma’s picture

Version: 5.x-3.0-test2 » 5.x-3.0
Status: Needs review » Needs work

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

j0k3z’s picture

emlomar1 - your 2 lines of code fixed an issue that has been driving me nuts for 2 days. Thank you.

EvanDonovan’s picture

As per #15, the location.inc patch does not work with Location 5.x-3.0.

jessicakoh’s picture

subscribing.

erem’s picture

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..!

internets’s picture

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...

yesct’s picture

Status: Needs work » Closed (duplicate)
Issue tags: +location importing

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.

yesct’s picture