views_join_term_edge.inc in Taxonomy Edge 7.2
File
views_taxonomy_edge/handlers/views_join_term_edge.inc
View source
<?php
class views_join_term_edge extends views_join {
function build_join($select_query, $table, $view_query) {
$found = FALSE;
foreach ($view_query->where as $data) {
foreach ($data['conditions'] as $condition) {
if ($condition['field'] == $table['alias'] . '.parent') {
if ($condition['value'] == '') {
$condition['value'] = taxonomy_term_edge_get_root_pid();
}
else {
$found = TRUE;
break;
}
}
}
}
if (!$found) {
$this->extra = array(
array(
'field' => 'parent',
'value' => taxonomy_edge_get_root_pid(),
),
);
}
parent::build_join($select_query, $table, $view_query);
}
}