From: nperez Date: Tue, 9 Feb 2010 05:26:50 +0000 (-0600) Subject: Attribute building order is important for offset-based paging X-Git-Tag: 2.001002~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=fa2501f0e73eb2e57f012f53b43d8a567e9e1c41 Attribute building order is important for offset-based paging --- diff --git a/lib/Catalyst/Controller/DBIC/API/RequestArguments.pm b/lib/Catalyst/Controller/DBIC/API/RequestArguments.pm index 5dedb28..54ec8eb 100644 --- a/lib/Catalyst/Controller/DBIC/API/RequestArguments.pm +++ b/lib/Catalyst/Controller/DBIC/API/RequestArguments.pm @@ -471,10 +471,10 @@ request_data holds the raw (but deserialized) data for ths request $self->_set_as($new->{$controller->as_arg}) if exists $new->{$controller->as_arg}; $self->_set_grouped_by($new->{$controller->grouped_by_arg}) if exists $new->{$controller->grouped_by_arg}; $self->_set_ordered_by($new->{$controller->ordered_by_arg}) if exists $new->{$controller->ordered_by_arg}; - $self->_set_search($new->{$controller->search_arg}) if exists $new->{$controller->search_arg}; $self->_set_count($new->{$controller->count_arg}) if exists $new->{$controller->count_arg}; $self->_set_page($new->{$controller->page_arg}) if exists $new->{$controller->page_arg}; $self->_set_offset($new->{$controller->offset_arg}) if exists $new->{$controller->offset_arg}; + $self->_set_search($new->{$controller->search_arg}) if exists $new->{$controller->search_arg}; } ); @@ -588,6 +588,7 @@ This builder method generates the search attributes elsif(!$self->has_page && defined($search_attributes->{offset}) && defined($search_attributes->{rows})) { $search_attributes->{page} = $search_attributes->{offset} / $search_attributes->{rows} + 1; + delete $search_attributes->{offset}; }