1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fix for incorrect page-count in pagination when using search and filters.

This commit is contained in:
Cameron 2013-11-08 22:36:42 -08:00
parent 1dff46e88d
commit dd24e913a7

View File

@ -3168,7 +3168,13 @@ class e_tree_model extends e_front_model
if(false === $this->_total && $this->getModelTable() && !$this->getParam('nocount'))
{
//SQL_CALC_FOUND_ROWS not found in the query, do one more query
$this->_total = e107::getDb()->db_Count($this->getModelTable());
// $this->_total = e107::getDb()->db_Count($this->getModelTable()); // fails with specific listQry
// Calculates correct total when using filters and search. //XXX Optimize.
$countQry = preg_replace('/(LIMIT ([\d,\s])*)$/', "", $this->getParam('db_query'));
$this->_total = e107::getDb()->gen($countQry);
}
unset($tmp);