Fix that queryfilters are being ignored by the parser

This commit is contained in:
Johannes Meyer 2014-03-17 16:08:12 +01:00
parent 0227c6a49d
commit e355415164
3 changed files with 7 additions and 8 deletions

View File

@ -193,8 +193,7 @@ class TreeToSqlParser
if ($tree->root == null) {
return;
}
$tree->root = $tree->normalizeTree($tree->root);
$sql = $this->nodeToSqlQuery($tree->root);
$sql = $this->nodeToSqlQuery($tree->normalizeTree($tree->root));
if ($this->filtersAggregate()) {
$baseQuery->having($sql);

View File

@ -232,12 +232,12 @@ class Tree
$node->left = $this->removeInvalidFilter($node->left, $filter);
$node->right = $this->removeInvalidFilter($node->right, $filter);
if ($node->left && $node->right) {
if ($node->left || $node->right) {
if (!$node->left) {
$node->left = $node->right;
$node->right = null;
}
return $node;
} elseif ($node->left) {
return $node->left;
} elseif ($node->right) {
return $node->right;
}
return null;

View File

@ -182,6 +182,6 @@ EOT;
return '';
}
$this->buildBaseUrl();
return $this->nodeToBadge($this->tree->root);
return $this->nodeToBadge(Tree::normalizeTree($this->tree->root));
}
}