Closed (fixed)
Project:
Drigg
Version:
5.x-1.32
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2008 at 14:04 UTC
Updated:
18 Jun 2008 at 20:06 UTC
Hi,
Thanks for this great module! On my taxonomy pages I got these two errors all the time:
user warning: Unknown column 'n.type' in 'where clause' query: SELECT vid, description FROM Kiesje_term_data td LEFT JOIN Kiesje_drigg_node dn2 ON dn2.dnid = n.nid WHERE ( 1=1 AND !(n.type='drigg' AND n.promote=0) AND !(n.type='drigg' AND dn2.killed=1 ) ) AND ( !(n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) ) ) AND ( td.tid = 2528) in /public_html/includes/database.mysql.inc on line 172.
user warning: Unknown column 'n.type' in 'where clause' query: SELECT description FROM Kiesje_vocabulary LEFT JOIN Kiesje_drigg_node dn2 ON dn2.dnid = n.nid WHERE ( 1=1 AND !(n.type='drigg' AND n.promote=0) AND !(n.type='drigg' AND dn2.killed=1 ) ) AND ( !(n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) ) ) AND ( vid = 0 ) LIMIT 1 in /public_html/includes/database.mysql.inc on line 172.
Thanks in advance for going into this.
greetings,
Martijn
Comments
Comment #1
summit commentedHi,
Is it maybe related to: http://drupal.org/node/200837 ?
EDIT: this is also related I think http://drupal.org/node/207521#comment-683476
EDIT2: Also tried 1.dev from 27 May.
but I still have above user warnings!
greetings,
Martijn
Comment #2
mercmobily commentedHi,
I checked the code: It's all correct.
I _REALLY_ think it's another module messing things up.
Please:
1) Give us a list of external modules you are using
2) Take those modules off one by one, and check CAREFULLY if the issue is not there. Try to locate which module is causing this
3) Let me know which module it is.
I am 98.87% sure it's another module messing up the query.
ALSO, please provide the exact step to reproduce this, "On my taxonomy pages" is not precise enough. You need to provide a list of URLs/operation your mum should be able to follow.
Bye!
Merc.
Comment #3
summit commentedHi Merc,
I will tell you how I got there the end of the week. I am now not at home till thursday.
But how can another module messing up if the message is about n.type = "drigg" and this sort of warnings already been reported?
I will tell you the steps. All modules to go step by step is not an option, because I use the taxonomy module inside panels (term/% usage) and taxonomy context to get to the taxonomy terms.
I almost have written down how to get there if I read things back..but now my money is up on the wifi!.
Thanks for going into this.
Greetings,
Martijn
Comment #4
mercmobily commentedHi,
How can another module cause this? Well, it's a bit of a long story...
Drigg does a "last minute rewrite" for every database query that is run. This is to guarantee that "killed" nodes are not fetched. I do this using a hook:
function drigg_db_rewrite_sql($query, $primary_table, $primary_field, $args){
Now, I am VERY specific in my hook function: it only works if the query passed works on a node:
// This will only filter node lists
if($primary_table=='n' && $primary_field == 'nid'){
When you run ANY query, modules surround the query with db_rewrite() which will in turn call the hook. That "n" means that the query is on a node, and that primary field is to check that the query's primary ID is "nid". However, db_rewrite() is a bit of a pain in that "n" and "nid" are the defaults. So, one of your extra modules is calling db_rewrite() around a query, AND it's leaving the defaults... AND it's doing so while running a query NOT on the node table.
Hence the mistake.
Now, if by this: "All modules to go step by step is not an option" you meant that you are not going to do what I asked, that is disable the modules one by one until the error goes, I am afraid I will have to mark this as a "won't fix" as that's the only way for me to investigate it. I don't mean this in a nasty way: it's just that I won't have a choice. I am already probably hunting a problem with *another* module. There is only so much I can do.
Bye,
Merc.
Comment #5
summit commentedHi Merc,
Thanks for the explanation. Off course I will try to do what you ask, but some modules are needed to get the query in the first place. I can't do it know because I am on the road.
May be somebody else also has this experience and can meanwhile tell his results?
Please community?
Thanks in advance! Greetings, Martijn
Comment #6
mercmobily commentedHi,
There is nobody else who can help you, because it's definitely a problem specific with a specific module you are using right now.
You are the only person able to actually find it... the most important question is: which module is making the query?
Bye,
Merc.
Comment #7
summit commentedThe needle in the heysteck...is there a global search to make how to get to the wrong query please?
Thanks a lot for your support so far Merc, I think you are right..will investigate further.
EDIT: The vid, description makes me think of the taxonomy_intro module...
greetings,
Martijn
Comment #8
mercmobily commentedHi,
Sorry, the way to search depends on your OS and it's a little bit tricky. As I said, the best way is to disable one module at a time (see my detailed checklist/explanation above).
Bye,
Merc.
Comment #9
Richard_ commentedI had this error too I guess>
* user warning: Table 'dbtest.node' doesn't exist query: SELECT * FROM d5drigg_node dn LEFT JOIN node n on dn.dnid=n.nid WHERE dn.url='' in /home/www/test/www/m/includes/database.mysql.inc on line 172.
I made fresh install and problem disapeared sofar. The only difference is that I didnt put table prefix on fresh install, but I doubt thats the case...
Comment #10
mercmobily commentedHi,
Ah!
Another bug!
Please change drigg/drigg/helpers.inc, line 653, from:
$sql = "SELECT * FROM {drigg_node} dn LEFT JOIN node n on dn.dnid=n.nid WHERE dn.url='%s' $nid_query";
Into:
$sql = "SELECT * FROM {drigg_node} dn LEFT JOIN {node} n on dn.dnid=n.nid WHERE dn.url='%s' $nid_query";
I can't believe I left it like that... sorry!
Summit: does this fix your bug too?
Bye,
Merc.
Comment #11
summit commentedHi Merc,
Yes bug is gone!
Thanks for investigating it further!
greetings,
Martijn
Comment #12
mercmobily commentedHi,
Original poster: does #10 fix your problem too?
If not, please provide an update.
I will close this bug in 3 days unless more info is provided.
Merc.
Comment #13
summit commentedHi Merc, I am the original poster, am I not?
greetings,
Martijn
Comment #14
mercmobily commentedHi,
Summit: AH! So you are!
Ok, bug is squashed :-D
Merc.
Comment #15
mercmobily commentedComment #16
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.