[Rt-commit] r19764 - in rt/3.999/trunk: lib/RT/Model

sartak at bestpractical.com sartak at bestpractical.com
Tue May 26 23:09:12 EDT 2009


Author: sartak
Date: Tue May 26 23:09:11 2009
New Revision: 19764

Modified:
   rt/3.999/trunk/lib/RT/Model/TicketCollection.pm
   rt/3.999/trunk/t/api/paging.t

Log:
Preserve paging properly across from_sql

Modified: rt/3.999/trunk/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/TicketCollection.pm	(original)
+++ rt/3.999/trunk/lib/RT/Model/TicketCollection.pm	Tue May 26 23:09:11 2009
@@ -2744,10 +2744,10 @@
     my ( $self, $query ) = @_;
 
     {
-
-        # preserve first_row and show_rows across the clean_slate
-        local ( $self->{'first_row'}, $self->{'show_rows'} );
+        # preserve paging across the clean_slate
+        my $per_page = $self->pager->entries_per_page;
         $self->clean_slate;
+        $self->set_page_info(per_page => $per_page);
     }
     $self->_init_sql();
 

Modified: rt/3.999/trunk/t/api/paging.t
==============================================================================
--- rt/3.999/trunk/t/api/paging.t	(original)
+++ rt/3.999/trunk/t/api/paging.t	Tue May 26 23:09:11 2009
@@ -20,8 +20,5 @@
     ++$count;
 }
 
-TODO: {
-    local $TODO = "Doesn't work yet!";
-    is($count, 5, "set_page_info");
-}
+is($count, 5, "set_page_info");
 


More information about the Rt-commit mailing list