Googling this issue doesn't pull up anyone with the same problem.

I have a location field in a custom member profile I've created, and everything was working fine. Suddenly now, after the location information is saved in a profile, it disappears and I see in the logs a notice from the location module with this:

"Deleting unreferenced location with LID 11."

Why are these locations "unreferenced" suddenly, and why are they being deleted? :(

Comments

sansui’s picture

Well, I think I narrowed down when it occurred

I moved the location field out of a fieldgroup it was in, in my profile content type. New users that sign up have their location information saved just fine - but any previous user (like my admin account), get the location information deleted when trying to save the profile.

Any way to fix this manually in the database for such users? And why would this issue be caused simply by changing the fieldgroup the location field was grouped in, in the content type?

sansui’s picture

I tried going into the database, and modifying the lid of the admin's profile in question to an existing entry (which should have been the row it was using to begin with). This worked until I tried editing my profile node and then saving it, at which point the location module promptly deleted it, and now there's a totally new LID in the admin's profile, which links to nothing.

sansui’s picture

More information:

Using a CCK Location field to add a location field to my member profile content type

When creating a new test user, as long as I don't modify the address at all, the address will remain saved. If I change anything in the address, location module says I have an unreferenced address and deletes the updated info (is it trying to create a new location instead of updating the existing location?)

When I look at a node directly and view the dev render, I see the original address information stored in the location array.

My only guess as to what's happening, is that if you change the information in the CCK location field, it tries to create a new location with new LID, and it sets the profile node's LID to that new LID (which results in no information being pulled up when I view my profile panel or editing the node).

Somehow the original location and lid is still associated with the node, as I can see it in dev render.

sansui’s picture

Is this issue in this thread - http://drupal.org/node/327381 - the same as here? CCK Location integration is fubar and should not be used?

sansui’s picture

If anyone is capable of providing a solution, we are willing to pay

yesct’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +location cck, +location still an error question

You did a really good description of your problem. I'm sorry no one had any ideas for you.

There have been lots of fixes committed to the dev version. Are you still having this problem with the most recent version? Post back and let us know.

sansui’s picture

I have not tested the most recent version, but back in February we simply worked around it by enabling location for the profile node, and removing it from the cck fields. That worked fine :)

yesct’s picture

marked #393216: Deleting unreferenced location with LID NNNNNN as a duplicate of this issue.

Dave Cohen’s picture

I've experienced this problem. I'm not using the CCK field, just enabled it for nodes (and users, but I think the problem is nodes).

yesct’s picture

Dave, What version (or date) are you using?

yesct’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Sansui has a fix and no response from Dave, so marking closed. Please change the status back to active and add more information if you have this problem still.

lodderig’s picture

Title: Deleting unreferenced location with LID » Deleting unreferenced location with LID
Version: 5.x-3.0 » 6.x-3.1-rc1
Priority: Normal » Critical
Status: Closed (fixed) » Active

I am unable to store new locations in a cck_location field using the recent versions (as of July 6) of Gmap and location

Checking the logs shows

Conserving lid NN due to uniqueness.
Deleting unreferenced location with LID

benstallings’s picture

Version: 6.x-3.1-rc1 » 6.x-3.1
Category: support » bug
Priority: Critical » Normal

I am also having this problem with 6.x-3.1 and cannot switch to using Node Location because I'm already using Node Location on the same content type -- storing street addresses in node locations and mailing addresses in CCK.

For what it's worth, I tried commenting out the lines in location.module that delete unreferenced locations, and that is apparently not the problem... the CCK locations are still not remaining in the locations table. I suspect this may have to do with the fact that they're not getting recorded in location_instance either -- none of my CCK locations are recorded there; there is nothing in the genid column whatsoever. :-(

Will report back when I have more info.

benstallings’s picture

OK, after some experimentation it appears that my problem, at least, is that I'm using Node Locations and Location CCK on the same content type. They are apparently not compatible. I'm filing a new documentation issue here: http://drupal.org/node/860820

yesct’s picture

just linking to 860820 using the nice bracket # nnnnnnn bracket notation

#860820: Teach location_node how to avoid cck locations

alfthecat’s picture

subscribing

rooby’s picture

goose2000’s picture

Version: 6.x-3.1 » 6.x-3.x-dev

Well, I have been seeing this issue when trying to import users. Yes I use Location CCK on my "content profile" type. The node and user location modules are not activated.

Odd thing is, the ZIP code always imports fine but other fields (address, city, state) do not come through.

location 10/06/2011 - 12:38pm Deleting unreferenced location with LID 59.
location 10/06/2011 - 12:38pm Deleting unreferenced location with LID 58.

I guess this is a no go and I'll just use plain CCK fields for address info, bummer, what a waste.

Gastonia’s picture

I am now getting the same issue for drupal 7.15

harings_rob’s picture

i'm also having this issue now, on a clean install of drupal

luxpir’s picture

Same issue here. Would like to get to the bottom of this one.

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life

ferrete’s picture

I had the same issue.
In my case i had a user location field that suddenly when saved a profile, the location info disappears.
To solve this i reinstall the location module, run cron and just work fine.
I also disable node location module.
Check in DB the location table to see if you have some LID available. (big bug in this module)