Michael Rehbein helpfully supplied a patch and unit tests for this issue, so
I'll be merging that in sometime this week or Sunday.  In the meantime, feel
free to patch your code manually:

http://framework.zend.com/issues/browse/ZF-4151

Index: library/Zend/Paginator/Adapter/Null.php

===================================================================
--- library/Zend/Paginator/Adapter/Null.php     (revision 21071)
+++ library/Zend/Paginator/Adapter/Null.php     (working copy)
@@ -58,7 +58,7 @@
      */
     public function getItems($offset, $itemCountPerPage)
     {
-        if ($offset > $this->count()) {
+        if ($offset >= $this->count()) {
             return array();
         }

-Matt

On Tue, Feb 16, 2010 at 7:06 AM, umpirsky <umpir...@gmail.com> wrote:

>
> This code:
>
> $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Null(0));
>
> gives:
>
> Warning: array_fill(): Number of elements must be positive in
> Zend/Paginator/Adapter/Null.php on line 68 Warning: Passed variable is not
> an array or object, using empty array instead.
>
> also, please note that   public function __construct($count = 0) is default
> value for item count in Zend_Paginator_Adapter_Null.
>
> So, it fails if item count is 0. Should I post a bug or I'm missing
> something?
>
> PHP Version 5.2.12
>
> Regards,
> Sasa Stamenkovic.
> --
> View this message in context:
> http://n4.nabble.com/Warning-array-fill-Number-of-elements-must-be-positive-in-Zend-Paginator-Adapter-Null-tp1557439p1557439.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to