diff --git a/modules/taxonomy.views.inc b/modules/taxonomy.views.inc index 58d62d1..09d9ff5 100644 --- a/modules/taxonomy.views.inc +++ b/modules/taxonomy.views.inc @@ -370,6 +370,31 @@ function taxonomy_views_data() { ), ); + // ---------------------------------------------------------------------- + // term_hierarchy table (reversed) + + $data['taxonomy_term_hierarchy_reversed']['table']['group'] = t('Taxonomy term'); + $data['taxonomy_term_hierarchy_reversed']['table']['join'] = array( + 'taxonomy_term_data' => array( + // links to taxonomy_term_data via parent + 'table' => 'taxonomy_term_hierarchy', + 'left_field' => 'tid', + 'field' => 'parent', + ), + ); + + $data['taxonomy_term_hierarchy_reversed']['child'] = array( + 'real field' => 'tid', + 'title' => t('Child term(s)'), + 'help' => t('The children of the term. This can produce duplicate entries for terms with multiple children.'), + 'relationship' => array( + 'table' => 'taxonomy_term_hierarchy', + 'base' => 'taxonomy_term_data', + 'field' => 'tid', + 'label' => t('Child'), + ), + ); + return $data; }