ZF-3720: Setting the current page number causes the items to be fetched prematurely

Issue Type: Bug Created: 2008-07-22T15:49:35.000+0000 Last Updated: 2008-10-10T19:20:41.000+0000 Status: Resolved Fix version(s): - 1.6.1 (15/Sep/08)

Reporter: Hector Virgen (djvirgen) Assignee: Jurrien Stutterheim (norm2782) Tags: - Zend_Paginator

Related issues: Attachments:


Zend_Paginator will break if you set the current page number before setting the item count per page. It seems that setting the page number executes the select query to retrieve the items.

setCurrentPageNumber($page); $paginator->setItemCountPerPage($itemsPerPage); $items = $paginator->getItems(); // Incorrectly returns 10 items (the default count per page) // This works $paginator = Zend\_Paginator::factory($select); $paginator->setItemCountPerPage($itemsPerPage); $paginator->setCurrentPageNumber($page); // Must be done last $items = $paginator->getItems(); // Correctly returns 5 items ?>


Posted by Jurrien Stutterheim (norm2782) on 2008-07-23T09:43:15.000+0000

Fixed in revision 10307

Have you found an issue?

See the Overview section for more details.


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

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