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.
In trying to import into a content type with location information, only Location:Country, Location:Latitude and Location:Longitude are available from the drop down list in field-matching.
Comments
Comment #1
jcamfield CreditAttribution: jcamfield commentedIn node_import/supported/location.inc
commenting out as follows seems to fix this (perhaps a bug caused by the latest location.module?)
Line 12:
$fields = array();
foreach ((array)location_field_names() as $field => $fieldname) {
/** if (variable_get('location_'. $field .'_'. $type, $field == 'country' ? 1 : 0)) {
*/
$fields['node_import_location_'. $field] = t('Location: @fieldname', array('@fieldname' => $fieldname));
/** }
*/
}
Comment #2
jcamfield CreditAttribution: jcamfield commentedPatch at http://drupal.org/node/297009 seems to work.
Comment #3
baobab CreditAttribution: baobab commentedconfirm that it works for Location v.5x-3.0-rc2. Brilliant thank you.
For those who use Location v.5x-3.x-dev import didn't work for me.
Comment #4
uksigma CreditAttribution: uksigma commentedcross post from http://drupal.org/node/297009
Having had the location.inc file fix this bug work with the location.inc from #2 on the above link
and then updated location module today with location 5.x-3.0 (http://drupal.org/node/346395) the node import is not displaying all the location fields again
Comment #5
random_tom CreditAttribution: random_tom commentedSame problem exists for me i.e. node import does not recognise location fields. I have tried patch (#2) and the other solutions posted in this queue and the location queue. Still no joy though.
I'm testing on: Drupal 5.10 | Node Import 5.x-1.9 | Location 5.x-3.0
Any solutions or a point in the right direction would be gratefully appreciated.
Comment #6
jessicakoh CreditAttribution: jessicakoh commentedsubscribing.
Comment #7
jessicakoh CreditAttribution: jessicakoh commentedI tried the method from #1.
It works.
Thank you, jcamfield.
Comment #8
jessicakoh CreditAttribution: jessicakoh commentedI am able to see the missing location fields, however, it does not seem to be able to import those fields.
Comment #9
internets CreditAttribution: internets commentedI'm having the same issue using latest versions(dev for location) of all related modules. I tried fixes from previous comments without success.
When I go to map the fields for importing a csv file, location lat / lon / country show up. But Location address, state/province, zipcode, phone, fax etc do not show up.
I'm using the location field within a CCK if that make any difference.
Comment #10
erem CreditAttribution: erem commented#1 works for Node Import 5.x-1.9 / Location 5.x-3.0 : the fields show up on import menu.
HOWEVER data is not imported. See also http://drupal.org/node/297009#comment-1271766 since that doesn't work either.
Comment #11
jayjaydluffy CreditAttribution: jayjaydluffy commentedi applied #1 but like mostly said it displayed the entire "location:" fields BUT doesn't import anything.
but i did not even reach to that point when i encountered this error
Fatal error: Call to undefined function _location_province_select_options() in /home/smsadler/public_html/spnew/sites/all/modules/node_import/supported/location.inc on line 167
does everyone who did say that it still didn't work encountered this error too?
any update on this issue? it has been driving me crazy...anyone who has a workaround (except for backporting), pls share it here...
thanks
Comment #12
internets CreditAttribution: internets commentedI was having issues with this and tried the fixes in the related threads without success.
Since my site is in early development, I was able to switch to drupal 6 and all the latest 6.x modules and was able to import my location nodes without issue, and have them plotted on a gmap.
I know this isn't a fix... But switching to the latest versions of everything worked for me...
Comment #13
YesCT CreditAttribution: YesCT commentedmarked #297009: All Location Fields Don't Appear when Using Node Import Module as a duplicate of this issue. (it had a patch that seems not to work with the newer versions)
Comment #14
techutopia CreditAttribution: techutopia commentedsubscribing.
Comment #15
YesCT CreditAttribution: YesCT commentedInternets, did you use the Inc file win 6.x ?
If someone could post an example/instructions for location 6.x that would be great. Also did people get this to work with node locations or cck locations?
Thanks.
Comment #16
Summit CreditAttribution: Summit commentedSubscribing, +1 for D6 version.
EDIT: Interesting..it seems that node_import AND feedapi with feedapi_mapper_location have the same issues. It seems very difficult to get somehow location fields filled with data from an import...
In D6 also problems in this perspective.
EDIT2: Still having problems with location latitude and longitude info. does somehow $node->{$field_name}[$i]['inhibit_geocode'] = true; has to do with this. As stated on: http://groups.drupal.org/node/27864#comment-94876 (Fix 3) Translated from dutch, If you give yourself latitude and longtitude info, the location module screws it...
Greetings, Martijn
Comment #17
hampshire CreditAttribution: hampshire commentedI am using Node import 1.9 & Location 3.0 with Drupal 5.22. I have read through the available threads and they seem to just lead me back and forth between each other without a solution for the current versions. Is this the case or am I missing something as I have tried all the solution here and none seem to work.
Thank you.
Comment #18
YesCT CreditAttribution: YesCT commentedcheck out the migrate extras module which now has location (and soon location cck) support
http://drupal.org/project/migrate_extras
http://drupal.org/node/459236#comment-2757412
Comment #19
javi-er CreditAttribution: javi-er commentedIn case someone still have problems importing location latitude and longitude in Drupal 5, I looked to this issue and after comparing location module and node import implementation I found that there are a couple of variables that node import doesn't set.
Node Import will correctly import location lat and long with this small change, in line 127 of location.inc of node_import replace this:
with this:
I'm using Node Import 5.x-1.9 and Location 5.x-3.1-rc1
Comment #20
doublejosh CreditAttribution: doublejosh commentedNot able to pull in locations when doing a user import :(
Fields do not appear.