Closed (won't fix)
Project:
Location
Version:
5.x-2.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2008 at 23:44 UTC
Updated:
9 Oct 2008 at 23:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
aaron commentedthis was also reported at http://drupal.org/node/255020
Comment #2
bcn commentedI am also seeing this problem after a recent update of the locations module... I will test the patch and report back.
[UPDATE]
patch applies cleanly but does not seem to solve the issue for me. The problem I'm having is that when a location enabled node is being created the LAT/LONG does not get set for users that enter only a postal code. Once that user edits, and then saves the node, the lat/long geocoding sticks.
[UPDATE 2]
The problem I described above does not affect users with the ability to enter lat/long directly.
Comment #3
bcn commentedI believe there is a second issue at work here, therefore this patch does solve the problem it was intending to... I will open a new issue for the other problem I'm having.
Comment #4
ethanw commentedIt looks like the logic of the `if ($node->nid)`...`if ($result =...` clauses fails to add location data for new nodes, which have an nid/vid but do not yet have an entry in the location table. For new nodes, then, the $node->nid test passes but the db_query on the location table fails, even with the vid adjustment above. When the db_query fails, the code flows past the node->nid positive block but skips the "else" for the $node->nid test, causing no location geocoding info to be added to the location, though State and City lookup is executed since it is outside the scope of this logic. A fix is to replace the code like this:
With something like this, adjusting closing parens as needed:
This is not yet thoroughly tested, but does work for new and existing node cases. Patch attached (created using subversion).
Comment #5
bcn commentedPatch from #4 applies cleanly and based on my tests seems to finally fix the issue(s) here. As described in #4, the earlier patch only went part of the way.
Thanks!
Comment #6
ethanw commentedJust found one other small bug in this logic, with the above patch from #4, the second occurrence of
Should be changed to
I don't know why it was working before given this issue, may have been some weight tweaking i'd done.
Patch attached, incremental from #4
Comment #7
drawk commented(deleted - issue I was having was a configuration on my side)
Comment #8
bdragon commented2.x is confirmed broken when working with revisions.
#6 issue is a dupe of #125745: On new node creation user location isn't looked up.
2.x is closed.