? .svn
? taxonomy_breadcrumb-parent_terms-372813-19.patch
? po/.svn
Index: taxonomy_breadcrumb.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/taxonomy_breadcrumb/taxonomy_breadcrumb.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 taxonomy_breadcrumb.inc
--- taxonomy_breadcrumb.inc	24 Apr 2009 02:51:41 -0000	1.1.2.2
+++ taxonomy_breadcrumb.inc	7 May 2009 16:06:42 -0000
@@ -51,13 +51,13 @@ function _taxonomy_breadcrumb_term_page(
  */
 function _taxonomy_breadcrumb_node_get_lightest_term($nid) {
 
-/* We only want the first row of the result--this is the lightest term of the
- * lightest vocab.  This query should be the same as the query found in
- * taxonomy_node_get_terms.
- */
-  $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.nid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $nid);
+  // We only want the first row of the result. This is the lightest term of the
+  // lightest vocab.
+  $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {term_hierarchy} h ON t.tid = h.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.nid = %d ORDER BY v.weight, h.parent DESC, t.weight, t.name', 't', 'tid'), $nid);
+
   // Extract the first row of query.
   $term = db_fetch_object($result);
+
   return $term;
 }
 
