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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
e003a3c164
commit
1e52cb442b
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue