[Koha-bugs] [Bug 24229] /items API tests fail on Ubuntu 18.04

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 18 11:40:42 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24229

--- Comment #6 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Tomas, I tried to remove the changes made by bug 24700 but it did not work.

However, this worked (it is not a fix, but I wanted to confirm it came from
there):

diff --git a/Koha/REST/Plugin/Objects.pm b/Koha/REST/Plugin/Objects.pm
index 81cc97633c..430518251c 100644
--- a/Koha/REST/Plugin/Objects.pm
+++ b/Koha/REST/Plugin/Objects.pm
@@ -116,6 +116,7 @@ sub register {
                 $filtered_params = $c->merge_q_params( $filtered_params,
$query_params, $result_set );
             }
             # Perform search
+            $attributes->{page} = 1;
             my $objects = $result_set->search( $filtered_params, $attributes
);

             if ($objects->is_paged) {
diff --git a/t/db_dependent/api/v1/items.t b/t/db_dependent/api/v1/items.t
index 9eb623b96c..8b141ed781 100644
--- a/t/db_dependent/api/v1/items.t
+++ b/t/db_dependent/api/v1/items.t
@@ -78,7 +78,7 @@ subtest 'list() tests' => sub {
     my $items_count = Koha::Items->search->count;
     my $response_count = scalar @{ $t->tx->res->json };

-    is( $items_count, $response_count, 'The API returns all the items' );
+    is( 10, $response_count, 'The API returns all the items' );

     $t->get_ok( "//$userid:$password@/api/v1/items?external_id=" .
$item->barcode )
       ->status_is(200)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list