Bug 24457: Make overloaded ->to_api pass the params to parent method
authorTomas Cohen Arazi <tomascohen@theke.io>
Sun, 19 Jan 2020 05:06:00 +0000 (02:06 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 23 Jan 2020 09:06:03 +0000 (09:06 +0000)
This patch makes the overloaded to_api method for baskets care about the
remaining parameters, and pass them to SUPER::to_api.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> FAIL: Tests fail! No embedded bookseller!
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: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Acquisition/Basket.pm

index cdb885b..7a92747 100644 (file)
@@ -81,9 +81,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