Bugzilla – Attachment 97622 Details for
Bug 24459
Overloaded ->to_api needs to pass $params through
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24459: Make ->to_api pass $params through
Bug-24459-Make--toapi-pass-params-through.patch (text/plain), 1.78 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-20 12:51:17 UTC
(
hide
)
Description:
Bug 24459: Make ->to_api pass $params through
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-20 12:51:17 UTC
Size:
1.78 KB
patch
obsolete
>From beaf4ba1f763681db202cd2a2f36a659beec67b5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 20 Jan 2020 09:48:03 -0300 >Subject: [PATCH] Bug 24459: Make ->to_api pass $params through > >This patch makes the to_api method in Koha::Acquisition::Inovice and >Koha::Patron pass the passed parameters to the base class to_api method. >This is required for things like embedding related objects. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Patron.t \ > t/db_dependent/Koha/Acquisition/Invoice.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Acquisition/Invoice.pm | 4 ++-- > Koha/Patron.pm | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/Acquisition/Invoice.pm b/Koha/Acquisition/Invoice.pm >index 2432d18039..111f2644af 100644 >--- a/Koha/Acquisition/Invoice.pm >+++ b/Koha/Acquisition/Invoice.pm >@@ -39,9 +39,9 @@ suitable for API output. > =cut > > sub to_api { >- my ( $self ) = @_; >+ my ( $self, $params ) = @_; > >- my $json = $self->SUPER::to_api; >+ my $json = $self->SUPER::to_api( $params ); > > $json->{closed} = ( $self->closedate ) > ? Mojo::JSON->true >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index f48e67a696..8e3af0b2d4 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1558,9 +1558,9 @@ suitable for API output. > =cut > > sub to_api { >- my ( $self ) = @_; >+ my ( $self, $params ) = @_; > >- my $json_patron = $self->SUPER::to_api; >+ my $json_patron = $self->SUPER::to_api( $params ); > > $json_patron->{restricted} = ( $self->is_debarred ) > ? Mojo::JSON->true >-- >2.25.0
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 24459
:
97621
|
97622
|
97674
|
97675