Bugzilla – Attachment 67525 Details for
Bug 19370
Add a helper function for translating order_by params into SQL::Abstract
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19369: (followup) Rename params for consitency with 19370
Bug-19369-followup-Rename-params-for-consitency-wi.patch (text/plain), 2.45 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-10-02 16:22:27 UTC
(
hide
)
Description:
Bug 19369: (followup) Rename params for consitency with 19370
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-10-02 16:22:27 UTC
Size:
2.45 KB
patch
obsolete
>From b439a305f0c01400cfbeaa1d9a08076b7564649b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 2 Oct 2017 13:22:10 -0300 >Subject: [PATCH] Bug 19369: (followup) Rename params for consitency with 19370 > >--- > Koha/REST/Plugin/Pagination.pm | 17 +++++++++-------- > t/Koha/REST/Plugin/Pagination.t | 6 +++--- > 2 files changed, 12 insertions(+), 11 deletions(-) > >diff --git a/Koha/REST/Plugin/Pagination.pm b/Koha/REST/Plugin/Pagination.pm >index 55a9bf6c31..1afbfca09f 100644 >--- a/Koha/REST/Plugin/Pagination.pm >+++ b/Koha/REST/Plugin/Pagination.pm >@@ -110,27 +110,28 @@ It also adds X-Total-Count, containing the total results count. > > =head3 dbic_merge_pagination > >- $filter = $c->dbic_merge_pagination({ >- filter => $filter, >+ $attributes = $c->dbic_merge_pagination({ >+ attributes => $attributes, > params => { > page => $params->{_page}, >- per_page => $params->{_per_page} >+ per_page => $params->{_per_page}, >+ ... > } > }); > >-Adds I<page> and I<rows> elements to the filter parameter. >+Adds I<page> and I<rows> elements to the I<attributes> parameter. > > =cut > > $app->helper( > 'dbic_merge_pagination' => sub { > my ( $c, $args ) = @_; >- my $filter = $args->{filter}; >+ my $attributes = $args->{attributes}; > >- $filter->{page} = $args->{params}->{_page}; >- $filter->{rows} = $args->{params}->{_per_page}; >+ $attributes->{page} = $args->{params}->{_page}; >+ $attributes->{rows} = $args->{params}->{_per_page}; > >- return $filter; >+ return $attributes; > } > ); > } >diff --git a/t/Koha/REST/Plugin/Pagination.t b/t/Koha/REST/Plugin/Pagination.t >index 37cf0ca88d..698fd43a59 100644 >--- a/t/Koha/REST/Plugin/Pagination.t >+++ b/t/Koha/REST/Plugin/Pagination.t >@@ -53,9 +53,9 @@ get '/pagination_headers_last_page' => sub { > > get '/dbic_merge_pagination' => sub { > my $c = shift; >- my $filter = { firstname => 'Kyle', surname => 'Hall' }; >- $filter = $c->dbic_merge_pagination({ filter => $filter, params => { _page => 1, _per_page => 3 } }); >- $c->render( json => $filter, status => 200 ); >+ my $attributes = { firstname => 'Kyle', surname => 'Hall' }; >+ $attributes = $c->dbic_merge_pagination({ attributes => $attributes, params => { _page => 1, _per_page => 3 } }); >+ $c->render( json => $attributes, status => 200 ); > }; > > # The tests >-- >2.14.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19370
:
67379
|
67380
|
67402
|
67403
|
67525
|
67576
|
67782
|
67783
|
67784
|
69304
|
69305
|
69307
|
69383
|
69384
|
69391
|
69392
|
69393
|
69394