This might already be a bug, but I couldn't find it.

At any rate, when you do so, you get this little piece of loveliness:

Firey death

"PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '7x.taxonomy_term_node' doesn't exist: SELECT COUNT(*) AS expression FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {taxonomy_term_node} tn0 ON n.nid = tn0.nid WHERE (tn0.tid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1 ) in PagerDefault->execute() (line 86 of /Users/webchick/Sites/drupal/includes/pager.inc)."

This appears to be yet another critical error that testing bot isn't finding, since I'm pretty sure we have test coverage for this area of the code. If not, let's make sure we add some. ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timalsina’s picture

Yes, I am also having this issue on latest build (11/20/09). The testing bot isn't finding it.

Sivaji_Ganesh_Jojodae’s picture

+1
I can reproduce the same here with latest build.

mcarbone’s picture

Title: If you filter by taxonomy term at admin/content, the world ends in firey death » Rewrite outdated references to taxonomy_term_node

Looks like there are several outdated references to taxonomy_term_node, which after #412518: Convert taxonomy_node_* related code to use field API + upgrade path is no longer of our world.

modules/node/node.admin.inc:137: $query->join('taxonomy_term_node', $index, "n.nid = $index.nid");
modules/node/node.module:1549: $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');
modules/search/search.api.php:157: $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');
modules/taxonomy/taxonomy.tokens.inc:126: $sql = "SELECT COUNT (1) FROM {taxonomy_term_node} tn WHERE tn.tid = :tid";
modules/taxonomy/taxonomy.tokens.inc:180: $sql = "SELECT COUNT (1) FROM {taxonomy_term_node} tn LEFT JOIN {taxonomy_term_data} td ON tn.tid = td.tid WHERE td.vid = :vid";

mcarbone’s picture

Title: Rewrite outdated references to taxonomy_term_node » Rewrite outdated references of taxonomy_term_node to field API
mcarbone’s picture

Title: Rewrite outdated references of taxonomy_term_node to field API » Rewrite outdated references to taxonomy_term_node
Assigned: Unassigned » mcarbone

Two things:

1) We can use the denormalized taxonomy_index table to rewrite these.

2) Two of these have already been handled by #610022: Taxonomy Tokens: Fix old queries, so we only have to fix the first three.

modules/node/node.admin.inc:137: $query->join('taxonomy_term_node', $index, "n.nid = $index.nid");
modules/node/node.module:1549: $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');
modules/search/search.api.php:157: $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');

Assigning to myself to take these on.

mcarbone’s picture

Status: Active » Needs review
FileSize
9.91 KB

Patch rewrites the outdated queries, fixes a couple of small bugs involving advanced search by terms that popped up along the way, and adds tests for filtering by terms when searching, and on the content administration page.

Dries’s picture

Status: Needs review » Reviewed & tested by the community

This looks great, and comes with tests. Marking RTBC. Will commit later today unless someone objects.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Nope; looks great here, too.

Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.