I was having a lot of issues with location_cck module and found out it was not saving the nid and vid fields in the location_instance table.

Changing location_cck.module at approx. line 180 in the location_cck_field():
From:

location_save_locations($items, array('genid' => $genid));

To:

location_save_locations($items, array('nid' => $node->nid, 'vid' => $node->vid, 'genid' => $genid));

This change is now fixing many issues as locations are now loaded on noad load through location module. This fix is not fully tested so it needs some review.

Comments

bdragon’s picture

I wish people would quit rereporting this, 'nid'/'vid' and 'genid' are mutually exclusive for a single row.

Sure, it works around the fact that the parts of location don't know anything about cck locations, but it breaks the model.

It will be easier to understand this when node locations are broken out into a seperate module.

dragonwize’s picture

I am using locations pretty heavily so I am willing to make things right. Do you have some where I can get up to speed on your roadmap and vision? Anything in particular I can help out with right away?

bdragon’s picture

Views testing.
Comparison of views using CCK locations to "normal" node locations.
Simpletests.
Implementation of missing / buggy things in the views support for location_cck.
Implementation of missing / buggy things in the views support for "normal" locations, for that matter.
in gmap: A views version of gmap_location.module or extending the existing gmap_location.module to grok cck locations.

Any tests, or even *ideas* for tests, would be much welcome.

dragonwize’s picture

hmm... Views support? I am all for Views support but I would rather get the location_cck module working first before we add more support for it. Currently views support wouldn't do anything. I don't even think there would be a way to test views without the module working.

dragonwize’s picture

Status: Needs review » Fixed

Marking as fixed so that if someone come by to report the issue in the next couple weeks hopefully they will see this thread.

I've got a little while away from my work station so I am going to try and see if I can help clean up the issue queue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

YesCT’s picture

YesCT’s picture

KarenS’s picture

Status: Closed (fixed) » Active

I'm reopening this because it is the cause of a huge number of other issues. If you create a cck location field it is stored in the location db with only the cck info, no info about nid and vid. That means these cck fields will not show up anyplace the program is looking for node locations. CCK locations will not show up in the 'Location block' nor in node blocks nor anywhere else that nodes with locations would be plotted. If those values are stored, CCK locations will show up along with all other node locations, which is the way I would expect things to work.

At the same time, CCK location maps do not appear ANYWHERE else either. I posted a couple patches for this many months ago, and that is another issue, but with this fix they would at least show up in the location blocks. Since everyone using CCK location is flailing around trying to find some way to actually see the maps they are creating, they will sooner or later try to see them in blocks.

I understand that you have some reason in mind why they should not show up, but that seems counter-intuitive to me. Sorry if I'm missing the use case, but if I choose to store my data as CCK fields instead of in the original way in the node, those are still locations for that node that I would expect to see in all my node maps. I don't see any reason why I would *not* want them included.

dragonwize’s picture

The first step of fixing cck location to work was to get caching correct with cck. I fixed that and that patch has already landed.

The second part was making cck location backwards compat with node location as you mention here. That patch is #383244: location_cck back compat and views support and has not yet landed but hopefully will soon.

KarenS’s picture

Status: Active » Fixed

Ok, looks like that issue is going to be the preferred way to fix this, so I'm re-closing it.

Status: Fixed » Closed (fixed)
Issue tags: -location cck proximity view vid nid hack

Automatically closed -- issue fixed for 2 weeks with no activity.