The SQL that views generates returns NULL or 0° 0' 0" N, 0° 0' 0" E . Problem appears to be that there are no NID's/VID's stored in the location_instance table. Alt approach is available in the content_type_{content name} table; filter this via 'vid'. Code to get that

$fields = array();
foreach (content_fields() as $field) {
  if ($field['type'] == 'location') {
    $db_info = content_database_info($field);
    // Get Content Type DB name - FROM statement
    $fields[]['table'] = $db_info['table'];
    //Get File ID DB Column Name - SELECT statement
    $fields[]['column']  = $db_info['columns']['lid']['column'];
  }
}
print_r($fields);

Then JOIN above with location table's 'lid'. Adding a relationship is the wrong way to go about this (#347030: location_cck needs a views relation); never had to code for views so if someone could adapt the code above I would greatly appreciate that.

CommentFileSizeAuthor
#2 location_node_.1_4_1.patch1.12 KBRoobarb

Comments

yesct’s picture

Roobarb’s picture

StatusFileSize
new1.12 KB

My first post on the site, so I hope it's going to be of help to you. I'm using Location (but not Location CCK), and I had the same problem - it meant that I couldn't use Node Locations with the user registration page because the nid and vid were set to zero in the location_instance table. It took me ages to track that one down.

I think I've fixed it (or at least, it works for what I'm trying to do). Here's my first attempt at a creating a patch file. I'm a Drupal noob, so I hope this works!

libeco’s picture

I'm using this on a local test setup:
Drupal 6.11
Location 6.x-3.x-dev (2009-Apr-18)
Gmap 6.x-1.x-dev (2009-Apr-18)
CCk 6.x-2.2
Views 6.x-2.5

Using the dev versions was the only way for me to let a map show up in the location block in Drupal 6.11.

I used this patch (copied and pasted it manually because it was less work than actually finding out how to patch again).

I looked in the location_instance table and both nid and vid are set to 1, lid is set to 3, uid to 0 and genid is empty. I've only added one custom CCK (with no extra fields) with a location.

Does this make sense to you?

I'm trying to create a proximity search view, but I still can't find this only node with the method mentioned here. Is this what the patch was meant for?

Thanks in advance!

yesct’s picture

Status: Active » Postponed (maintainer needs more info)

If someone can confirm this is still a bug in the newest official release or new dev, please reply within 2 weeks with an updated summary and set the status back to active.

ankur’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing due to lack of follow up.