By nancydru on
I used taxonomy_del_vocabulary(4), and now, every page starts with this warning:
user warning: Unknown table 'term_node_4' in field list query: SELECT DISTINCT(node.nid), node.created AS node_created_created, node.title AS node_title, node.changed AS node_changed, term_node_4.name AS term_node_4_name FROM node node WHERE (node.type IN ('job')) ORDER BY node_created_created DESC LIMIT 0, 5 in /home/u3/helentsu/html/drupal/includes/database.mysql.inc on line 172.
How can I get rid of that?
Comments
Any idea where this query
Any idea where this query comes from?
Besides the "term_node_4" table I also notice a node_created_created alias. (machine made?)
The "LIMIT 0, 5" clause looks like something which would be used in a block. (disable some?).
I wouldn't be surprised if taxonomy_del_vocabulary(4) had no causal relation with this, just a temporal one.
My first thought
My first thought was that it was a mix up between taxonomy and locale. But it started happening right after I ran that code. The funny thing is that node/4 is the welcome message and has not vocabulary associated with it. I checked term_node and there are no entries for vocabulary 4, although there were some when it was deleted.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
But this does not explain
But this does not explain why a query would look for a *table* called "node_term_4". How would a deletion of some rows change a query.
I have no idea
And it is on every page, so it's something common to every page.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Some detective work for
Some detective work for tracing that query
A couple of grep searches in the contrib DRUPAL-5 branch for some characteristic strings from this did not reveal anything.
l would look for blocks produced by a query generator such as views, custom php blocks, inserted queries in the content, the theme's template.php, or anything configured to appear everywhere. Or a database search for "db_query(" php text might find something. Some tests with disabling stuff could probably help trace the query.
Well, duh
Yes, I had a Views block that used the taxonomy terms from vocabulary 4. I rebuilt the block and everything is fine. Thanks, so much.
The strange thing is I have another block that uses that vocabulary, and it's fine...
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
I just saw this in my code
I just saw this in my code while exporting a view:
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => '5',
),
),
It belongs to a view that works fine in development, but breaks on my production site (more precisely: all terms in the Taxonomy:Term filter disappear).
It's probably not related to this issue, but I guess there's no such thing as a table term_node_1?
To avoid duplicate posting, linking to my originial post: http://drupal.org/node/244644
In Views
I was looking at Views table structure a few days ago, and I think I remember seeing a table defined with that name, although there is no real table named that.
We've been fighting an issue in Taxonomy Image where the selection for "Taxonomy: All Terms" disappeared. Apparently because the module had a $tables for term_node that was unnecessary, so you may be experiencing something similar.
One thing I have found is that unless your test site is an exact copy of your production site, there may be small differences when you export/import that break the view. Some of these are little things like term number (tid) differences or even different vocabulary numbering (vid) that will throw the imported view off.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Thanks Nancy. I do use
Thanks Nancy. I do use Taxonomy image. Did you find a way to bring the Taxonomy:All terms back?
I think so
I think the issue (http://drupal.org/node/239621) is pretty much resolved now. We're just waiting on some final expert confirmation.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
I had exactly the same
I had exactly the same problem and found a brief comment about it sounding like a cache issue, sure enough, when I deleted my cache, everything worked again. Not sure about this but I'm still in development so haven't turned my cron on yet, maybe not running that often enough causes issues... dunno!
Will Eaton