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

bdragon - August 19, 2008 - 03:55
Category:bug report» task
Assigned to:Anonymous» bdragon

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

I'll cook up a patch.

#2

bdragon - August 19, 2008 - 04:33
Status:active» needs review

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

AttachmentSize
location.inc_.patch 3.67 KB

#3

bdragon - August 19, 2008 - 04:35

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

bdragon - August 19, 2008 - 04:36

(try 2)

AttachmentSize
location.inc_.txt 7.15 KB

#5

mlondon77 - August 20, 2008 - 12:51

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

Robrecht Jacques - August 22, 2008 - 18:13

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?

#7

mlondon77 - August 26, 2008 - 10:53

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

DanielJohnston - October 11, 2008 - 12:28

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

hansrossel - November 13, 2008 - 20:15

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

scandi - November 15, 2008 - 13:04

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

#11

uksigma - November 17, 2008 - 15:28

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

scandi - November 17, 2008 - 22:21

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

#13

uksigma - November 18, 2008 - 11:00

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

emlomar1 - November 26, 2008 - 12:12

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

uksigma - December 18, 2008 - 16:52
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

#16

j0k3z - January 26, 2009 - 20:45

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

#17

EvanDonovan - February 11, 2009 - 21:16

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

#18

jessicakoh - February 15, 2009 - 15:13

subscribing.

#19

erem - February 22, 2009 - 00:11

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

internets - February 21, 2009 - 18:44

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

YesCT - April 16, 2009 - 07:49
Status:needs work» duplicate

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

YesCT - April 16, 2009 - 07:54
 
 

Drupal is a registered trademark of Dries Buytaert.