After much frustrating debugging and testing, I found that when Node Locations is enabled for a content type, Location CCK will not work on that same content type. It would have been really good to know this going in, so I'd like to respectfully request that the project page be updated with a disclaimer: Node Locations and Location CCK cannot be used on the same content type at the same time.

Steps to replicate the problem:

  1. Install and enable Location, Node Locations, CCK, and Location CCK.
  2. Create a content type. Add a Location CCK field.
  3. Create a node of this type. Verify that you can add and edit locations in the CCK location field.
  4. Edit the content type and set the Locative Information to allow one or more locations.
  5. Edit the node again and add a location to it. It will default to the location you previously entered in the CCK field.
  6. Edit the node again and change the CCK location. Notice how it disappears, no matter what you do.

I'm off to switch my node locations to CCK... hope this saves someone a headache!

Comments

rooby’s picture

I think the problem itself should be fixed to allow for them to work together. See #906968: CCK Location Fields do not save when Node Locations are enabled. for this.

But in the meantime it would be a good idea to mention it somewhere, like the handbook and readme.

rooby’s picture

Status: Active » Fixed

I have added a know issues section to the INSTALL.txt file with information about this.
I have also added a know issues section to the drupal.org handbook here - http://drupal.org/documentation/modules/location - and added notes in the installation & configuration sections of the handbook.

http://drupal.org/cvs?commit=494678
http://drupal.org/cvs?commit=494680
http://drupal.org/cvs?commit=494682
http://drupal.org/cvs?commit=494684

bdragon’s picture

The reason that they aren't compatible is because ankur forced the issue of giving cck locations nid and vid values in {location_instance} while I wasn't paying attention, without at the same time updating the node locations module to have a genid so it can tell its own instances apart from others. The nid and vid columns were supposed to be owned solely by node locations.

I believe the original issue was #391160: CCK/Views: location_instance fix. I had been blocking stuff like this for a long time because I was afraid what would happen if the purpose of nid and vid in {location_instance} were repurposed like this.

bdragon’s picture

Title: Clarify that Node Locations is not compatible with Location CCK » Teach location_node how to avoid cck locations
Version: 6.x-3.1-rc1 » 7.x-4.x-dev
Component: Documentation » Code
Assigned: Unassigned » bdragon
Category: task » bug
Priority: Normal » Major
Status: Fixed » Active

As a matter of fact, I'm going to consider the fact that location_node can't tell the difference between its own locations and cck locations to be a bug.

rooby’s picture

Making everything use the fields api for locations would have a very positive impact on this problem but doesn't help much for D6.

Also, either this or #906968: CCK Location Fields do not save when Node Locations are enabled. should be made master for this issue.

rooby’s picture

There is another probably duplicate issue at #378132: Deleting unreferenced location with LID