Skip to content

Commit

Permalink
Update legacy.php
Browse files Browse the repository at this point in the history
See #5008
  • Loading branch information
Humorlos committed Nov 7, 2014
1 parent e9dcb83 commit 50e371c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libraries/legacy/model/legacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,14 @@ protected function _getListCount($query)
&& $query->having === null)
{
$query = clone $query;
$query->clear('select')->clear('order')->clear('limit')->select('COUNT(*)');
$query->clear('select')->clear('order')->clear('limit')->select('*');

$query2 = $this->_db->getQuery(true);

$query2->clear('select')->clear('from')->select('COUNT(*)')->from('(' . $query->__toString() . ') as xyz');


$this->_db->setQuery($query2);

$this->_db->setQuery($query);

Expand Down

0 comments on commit 50e371c

Please sign in to comment.