-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle HAVING clause which does not accept alias in filter queries #1028
base: master
Are you sure you want to change the base?
Conversation
To be up to date
To handle query from filter with necessary HAVING clause which does not accept alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for this PR.
Some changes need to be done in order to continue.
@@ -437,7 +441,7 @@ public function execute($columns, $page = 0, $limit = 0, $maxResults = null, $gr | |||
|
|||
$columnForFilter = (!$column instanceof JoinColumn) ? $column : $columnsById[$filter->getColumnName()]; | |||
|
|||
$fieldName = $this->getFieldName($columnForFilter, false); | |||
$fieldName = $this->getFieldName($columnForFilter, false, $hasHavingClause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you add a parameter to this function, you should change its signature wich is actually
protected function getFieldName($column, $withAlias = false)
@@ -245,6 +245,10 @@ protected function getFieldName($column, $withAlias = false) | |||
|
|||
return "$functionWithParameters as $alias"; | |||
} | |||
// To handle query from filter with necessary HAVING clause which does not accept alias | |||
if (!$withAlias && $hasHaving) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $hasHaving comes from nowhere.
I guess that it should be $hasHavingClause given as parameter of the function ?
To handle query from filter with necessary HAVING clause which does not accept alias