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.
I've seen some patches for Drupal 5, but it doesn't look like those would work for Drupal 6. Anyone have any ideas on how to import location data (address, city, state, postal code) in Drupal 6?
Comment | File | Size | Author |
---|---|---|---|
#45 | content_profile.patch | 3.09 KB | Steve Dondley |
#21 | location_cck.inc_.txt | 4.72 KB | Ryan Palmer |
#36 | label_locations.patch | 347 bytes | nemchenk |
#35 | line_30.patch | 1002 bytes | nemchenk |
#28 | location_cck.inc_.txt | 4.91 KB | mstrelan |
Comments
Comment #1
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedDo you have a sample CSV file (10 rows or something like that) you like to import?
Comment #2
Webster619 CreditAttribution: Webster619 commentedNot yet. I don't want to gather data in Excel until I think I can import it.
However, I would just have basic location data:
Address
City
State
Zip
Phone
as headings in the first row, and columns of data underneath. Any ideas?
Thanks
Comment #3
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedIn -rc4 you'll be able to import Location. That's why I wanted a CSV file to test a little, but I suppose I can make one myself.
Comment #4
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedFixed in CVS. Will be included in upcoming -rc4 release.
Comment #5
hvalentim CreditAttribution: hvalentim commentedJust installed and tried the dev version tar.gz, dated from today.
A few issues trying to import Location fields:
Thank You.
Comment #6
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedThanks for the sample file. You are correct, longitude and latitude were not handled correctly. Fixed.
As I mostly test with CSV file, this error had not previously occurred to me. Fixed.
Indeed. Fixed.
Thanks for testing!
Comment #7
jcamfield CreditAttribution: jcamfield commentedRobrecht - if you need more testing, I have a test site and up to ~1000 test location records I hope to import. Let me know if you have a preferred version (or just the latest dev branch ver) you'd like me to play with.
Comment #8
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedjcamfield: I'll release -rc4 later today. If you could play with that and create an new issue if you find problems. Note that only Location will be supported, not yet CCK Location.
Comment #9
kevinwalsh CreditAttribution: kevinwalsh commentedas i wrote on http://drupal.org/node/207738#comment-1293396, it's looking good to me so far. i will be testing again in the next few days.
Comment #11
xurizaemonRe-opening. Installed D6 CVS just now, but CCK location field components do not appear as an option when mapping import columns to content type fields.
Edit: I see in comment #8 above that CCK Location is not supported as of RC4, but Location fields are.
Comment #12
jasontanner CreditAttribution: jasontanner commentedAs Location CCK seems to be reasonably stable for D6 now, it would be nice if it were added to Node Import soon.
Comment #13
GuyPaddock CreditAttribution: GuyPaddock commentedCourtesy of Red Bottle Design, LLC, please find attached an implementation of "Location CCK" support for Node Import.
Drop it into "supported/location", along-side location.inc (this implementation is independent of normal location node support).
DISCLAIMER: We wrote this to get a large import for one of our clients to work; as such, it has only been tested with our data from 900 or so records. In addition, the current implementation will not work with multiple-value location fields.
As always, your mileage may vary.
Comment #14
aterchin CreditAttribution: aterchin commentedGuy - works great, but unfortunately you don't get to set the default options ( step 6 of 8 i think). otherwise, you've got it working well if someone absolutely needs to use CCK, which actually i think is a preferred way to do stuff like this.
Very useful module, Robrecht.
(... now if they'd only get location cck working in feedapi_mapper :) )
Comment #15
GuyPaddock CreditAttribution: GuyPaddock commentedYeah, sorry about the lack of defaults. We have the defaults set in the content type, so that was sufficient here.
Location CCK is nice and all, but it still has a lot of quirks, especially when you hide "Country" instead of "Country name" and your map links disappear, or you enable phone support and find that it doesn't render anywhere. I think that more modules will start supporting it more when these quirks are fixed.
Comment #16
aterchin CreditAttribution: aterchin commentedagree. for now i'm just using the node location settings. there are ways of getting the data in there if and when i ultimately move my location data into cck. if and when.
Comment #17
ndm CreditAttribution: ndm commentedHello, i have problem with coordinates so i had a router in the end process to dispatch latitude and longitude.
Now if you want have coordinates, you must map a col with "latitude;longitude" and it's work.
Comment #18
Chris CharltonI'd like to see this make RC5, with defaults. :)
Comment #19
betamos CreditAttribution: betamos commentedI didn't know if I should start a new issue or not, but i have found a minor bug while importing location data:
To recreate the bug, you would probably need something like the following:
$node->location['latitude']
(and the same for longitude)This bug only occurs while in preview mode, the import itself works like a charm. I looked it up a little further, and it seems that
$node->location
is not even available while importing, which explains the mystic Africa-thingy. It appears that if no coordinates are given, it defaults to just below Ghana in the ocean, which only happens to have the coordinates 0.000000,0.000000, in the origo of the earth, right on the Equator :)However, the almost exact same array
$node->locations
(ending with an "s") is available in import mode perfectly fine.To sum it up: Node import does not acquire the
$node->location
array through node template while in preview mode.Comment #20
landry CreditAttribution: landry commentedto comment #13:
location_cck.inc worked fine for me, although a minor nit : in fields mapping selection, it only shows 'allowed' fields, not 'required' ones.
I'll change the check
to be also valid if the value is 2 (field is required).
Comment #21
Ryan Palmer CreditAttribution: Ryan Palmer commentedDidn't realize this was in process. Our take at Location CCK support inc file attached. Same instructions apply: remove the .txt extension, drop it into supported/location. I would have rolled a patch but I'm unable to "cvs add" the new file.
File attached adheres to Drupal coding standards whereas #13/17 are lacking.
Comment #22
Summit CreditAttribution: Summit commentedSubscribing, which version will be implemented, or is it possible to have best of all files here attached?
greetings, Martijn
Comment #23
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedCommitted #21 to CVS. Will be included in -rc5 release.
Comment #25
Chris CharltonI see this error filling up my error logs. This is probably one of the earlier patches above.
PHP Warning: Call-time pass-by-reference has been deprecated; sites/all/modules/contrib/node_import/supported/location/location_cck.inc on line 19
Comment #26
hutch CreditAttribution: hutch commentedIs there a '&' immediately before a variable on line 19? If so remove it and try again
Comment #27
mstrelan CreditAttribution: mstrelan commentedWhen will rc5 be released?
Comment #28
mstrelan CreditAttribution: mstrelan commentedHi
Using location_cck.inc from #21 I found that if you have two different CCK Location fields on the one content type you cannot distinguish between them when mapping fields. For example, if you have street address and postal address you just see Street, Street, Suburb, Suburb, Postcode, Postcode etc.
The attached file displays it as Street Address Street, Postal Address Street, Street Address Suburb, Postal Address Suburb, Street Address Postcode, Postal Address Postcode.
Comment #29
Summit CreditAttribution: Summit commentedHi,
Could you file a patch of it, then it is easier for the maintainer to commit this change.
Thanks!
greetings, Martijn
Comment #30
colanLet's get a patch file for this so that we can test it! I'll produce one eventually unless someone else does first.
Comment #31
patchak CreditAttribution: patchak commentedHey there, I get WSOD when using the file from #28 ...using with the latest dev. Maybe a patch would help to test indeed?
Comment #32
mbabayan CreditAttribution: mbabayan commentedApplied the patch; I am mapping Street Address, City, Postal Code and Phone, and I only get Postal Code imported - the rest of the fields are empty on the imported nodes.
Other CCK fields (outside of location) are mapped fine.
Where do I need to look ?
Thanks,
MB
Comment #33
lolmaus CreditAttribution: lolmaus commentedSubscribing
Comment #34
burgs CreditAttribution: burgs commentedI just used #28 (renamed obviously to .inc) and it worked fine for an import of over 300 rows. I was just importing into Street, Postal code and Telephone for a multi value cck location field.
Thanks!!
Location 6.x-1.0-rc4
Pressflow 6
Comment #35
nemchenk CreditAttribution: nemchenk commentedFound a small bug in location_cck.inc -- when creating a new Location CCK field for a content type, if you do not fill out the Configure screen for that field, location_cck.inc will throw the following:
"Fatal error: Cannot use string offset as an array in .../modules/node_import/supported/location/location_cck.inc on line 30"
The patch below (against node_import-DRUPAL-6--1 from CVS) checks to see if $settings['location_settings']['form'] exists before trying to access settings underneath it.
Comment #36
nemchenk CreditAttribution: nemchenk commentedSimilar to #28, I have two Location CCK fields for my user Content Profile -- one "Home" and one for "Work". The patch below labels them with whatever label the field has assigned, for example "Home: Postal Code" or "Work: Location name". Patch is against the DRUPAL-6--1 branch in CVS.
Comment #37
colanComment #38
Stephen Scholtz CreditAttribution: Stephen Scholtz commentedMan, I haven't been able to get this to work yet.
I'm running:
Drupal 6.19
Location CCK 3.1
User Import 2.3
Content Profile 1.0
Node Import Dev (July 11, 2010)
The Location fields are showing on the import screen and I can map them, but nothing actually gets into my database tables it seems.
Suggestions? I'll have to dig further... apologies if this turns out to be some other modules problem. :P
PS - sample import data:
Columns: User name, email, birthday, address 1, address 2, city, province, postal code, country, phone number, gender, what are you hoping to do here, do here details, how did you find out about the site, how found out details, roles
"GEORGE POPE","me@email.com","1967-02-20","Address 1","Address 2","Richmond","BC","Postal Code","ca","555-123-1234","male","other","Blah blah","other","Word of Mouth","User - Alumni,User - Imported from Old Site"
Comment #39
webankit CreditAttribution: webankit commented+1
Comment #40
bkat CreditAttribution: bkat commentedI'm having this exact same problem with 6.x-1.0 on drupal-6.20. Everything looks great on setup with my Location CCK field but nothing is getting put in the database.
Comment #41
bkat CreditAttribution: bkat commentedThere is an issue in the Location module where CCK Location does not save if the Node Locations module is enabled. You have to choose one or the other.
http://drupal.org/node/906968
That was part of my problem with CCK Location not being saved.
Comment #42
TechNikh CreditAttribution: TechNikh commented+1 subscribing..
Comment #43
goose2000 CreditAttribution: goose2000 commentedHi, subscribing. I have basic Location CCK added to my 'content profile' type. When I tried to upload users + their profile data (address info in this instance) only the zip field would get updated or saved.
log would report:
location 10/06/2011 - 12:38pm Deleting unreferenced location with LID 59.
location 10/06/2011 - 12:38pm Deleting unreferenced location with LID 58.
Comment #44
TheDanScott CreditAttribution: TheDanScott commentedI am also having the issue mentioned in #43 - only postcode comes through and messages in the log about deleting unreferenced locations.
I have the following Location CCK fields enabled:
Country,
Street,
City,
State / Province,
Postal Code
Comment #45
Steve Dondley CreditAttribution: Steve Dondley commentedHere's a patch to address the problem mentioned i comment #43 and #44 above. It's just a preliminary patch for review so I left in the debug code.
This patches the content_profile.inc file in the "supported" directory within the user import module.
By the way, that "rdpw" function in the debug code is a home-rolled print statement we use for our own in-house debugging. It should be replaced with the corresponding function in the devel module (which slips my mind at the moment).