Issues

ZF-7207: Warning: Division by zero

Issue Type: Bug Created: 2009-07-06T11:22:35.000+0000 Last Updated: 2009-07-31T20:49:50.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Adam Kusmierz (raistlin) Assignee: julien PAULI (doctorrock83) Tags: - Zend_Paginator

Related issues: Attachments:

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:

<pre class="highlight">
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

Posted by julien PAULI (doctorrock83) on 2009-07-07T00:25:59.000+0000

confirmed, I'm on it

Posted by julien PAULI (doctorrock83) on 2009-07-07T09:58:22.000+0000

fixed at SVN r16554

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts