APYDataGridBundle
APYDataGridBundle copied to clipboard
Problem method getTotalCount with groupBy
Hello,
I use datagrid with entity/annotation and i realized that the method "getTotalCount()" don't return the right result.
For example : I have 50 rows in db, when i group them on the title, only 6 rows are displayed, but the method still return 50.
Why don't replace this part of :
//APY/DataGridBundle/Source/Entity.php
public function getTotalCount($maxResults = null)
{
...
$data = $countQuery->getScalarResult();
$data = array_map('current', $data);
$count = array_sum($data);
}
by this ? :
//APY/DataGridBundle/Source/Entity.php
public function getTotalCount($maxResults = null)
{
...
$data = $countQuery->getScalarResult();
$count = count($data);
}
You can't for some case, but your bug is related to the #364
I saw, when the query has no "GROUP BY", but when has it, the result is wrong.