Closed (fixed)
Project:
Location
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jan 2007 at 18:34 UTC
Updated:
25 Jan 2007 at 02:45 UTC
Jump to comment: Most recent file
Is the Location table missing the 'lid' field?
I was getting the following error message with drupal 4.7.5 and 4.7.4 after trying to add location info to a node.
Unknown column 'lid' in 'order clause' query: SELECT * FROM location WHERE type = 'node' AND eid = 2 ORDER BY lid in /homepages/45/d96964899/htdocs/smiledating/includes/database.mysql.inc on line 121.
I added 'lid' field to the location table which seems to solve the problem.
Hope this helps, im no expert so I may be talking guff!
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | location.install_20070110_1739_patch.txt | 3.58 KB | sammys |
| #9 | location.install.diff | 3.78 KB | ankur |
Comments
Comment #1
nicolash commentedBut I don't understand how it could have ever worked. People have been using it for a while, though...
Comment #2
nicolash commented...just resetting the title for this issue...
Comment #3
ankur commentedThe last location update requires a schema update. You need to run update.php
Comment #4
rocnhorse commentedI just installed location 4.7 clean and have the same problem.
From the location.install file:
The lid field is added in the update functions but not in the install function. So you have to run update right after you originally install. :)
Comment #5
leobaby commentedI have to say there's something screwy going on here. I've tried installing per instructions and no luck, then installing without importing .mysql files first and still no luck. Tried importing .mysql files then upgrading and no luck. This is exactly what I hate about using drupal.
location.mysql (the manual says to use this one)
oid int(10) unsigned NOT NULL default '0',
ocation.install
eid int unsigned NOT NULL default '0',
from the location.upgrade.php
db_query("ALTER TABLE {location_node} CHANGE nid oid int(10) unsigned NOT NULL default '0'");
to make matters worse, it appears lid and and eid are both being treated as primary key getting the same data.
Comment #6
rocnhorse commentedIt looks like the update_4 changes haven't been added to the install script.
The workaround is to run update 4. This seems to resolve it.
Also it seems that if you're using PostgreSQL the update fails silently.
Comment #7
ankur commentedComment #6 has it right. I forgot to update the location_install() function when I updated the schema. I added a location_update_4() function, but forgot to reflect those changes in location_install(). This basically means that people that are just installing the module for the first time (after the most recent update) are gonna have problems. People who have run the update will be fine. In anycase, I will post a patch here shortly (in the next few hours) with instructions for those of you who just installed the module recently and got these 'lid' errors.
Sorry for the inconvenience.
-Ankur
Comment #8
yahmaster commentedThanks, waitin for the update.
Comment #9
ankur commentedOk. So this is the patch I'm supposin' to commit, but I do need someone familiar w/ PostgreSQL to verify my syntax, either with your super accurate attention to detail that doesn't require testing, or w/ your PostgreSQL database server through testing both the install function and the update from schema version 3 thru schema version 5.
As for people running this on mysql, it has been tested on mysql. So you can either apply this patch immediately, or you can wait til the pgsql is verified and the patch is committed.
In either case, for those of you that just installed location module on mysql and are having the problem w/ the missing lid column, you will need to delete every sign of the location module from your database before re-enabling it in your admin/modules section. To this end, I recommend running the following queries in your database (hopefully, you can run these via command-line or something like PhpMyAdmin):
If you are using a database prefix and this prefix, for example, is the string 'prefix_', then the queries would be:
Again, I apologize for the major inconvenience. I'd made notes to myself to do the pgsql and to update the location_install() function, but completely forgot about them when came the late-night commit to the CVS.
Comment #10
sammys commentedHi all,
I've updated the patch to be correct for PostgreSQL. I've also taken liberty to make the following alterations:
Here is the patch. I've tested it on PostgreSQL and it works ok without any records in the location table. I'm pretty sure it'll work with records. :)
--
Sammy Spets
Synerger
http://synerger.com
Comment #11
ankur commentedThanks for the patch. This has been committed to DRUPAL-4-7 and HEAD.
Comment #12
(not verified) commented