Issues

ZF-7207: Warning: Division by zero

Description

If you don't specify ItemCountPerPage (using setItemCountPerPage(int); or only call getItemCountPerPage();) on Zend_Paginator object , you'll get warning "Division by zero".

Stacktrace:


Warning: Division by zero in \library\Zend\Paginator.php on line 995
Call Stack
#   Time    Memory  Function    Location
(...)
6   1,2761  11095744    Zend_Paginator->getPages( ) ..\MyController.php:197
7   1,2761  11095744    Zend_Paginator->_createPages( ) ..\Paginator.php:791
8   1,2761  11097256    Zend_Paginator->count( )    ..\Paginator.php:1006
9   1,2761  11097408    Zend_Paginator->_calculatePageCount( )  ..\Paginator.php:471

You should use "getItemCountPerPage()" internally in Zend_Paginator class instead of private var, or initialize this private variable in constructor.

Comments

confirmed, I'm on it

fixed at SVN r16554