ZF-7434: Too many pages with empty content
I use a Paginator with DBSelect for querying the database. See the following code:
$select = $this->db->select(); $select->from(array("v" => "table"), array("DateDayFormat" => new Zend_Db_Expr("DATE_FORMAT(v.FirstVisitTime, '%d.%m.%Y')"), "PageCalls" => new Zend_Db_Expr("SUM(v.PageCalls)"), )) ->group("DATE(v.FirstVisitTime)") ->order("DATE(v.FirstVisitTime) DESC"); $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select)); $paginator->setItemCountPerPage(20); $paginator->setCurrentPageNumber($this->_getParam("page", 1)); $this->view->paginator = $paginator;
The select should return 6.5 pages, but there are 42 pages. the 7th to the 42nd page are empty. this problem occurs also with other selects, so it seems to be a bug - or did you change something, that would explain this strange behavior?