Bugzilla – Attachment 140572 Details for
Bug 25375
Elasticsearch: Limit on available items does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25375: Adjust tests and test itemlost, not notforloan
Bug-25375-Adjust-tests-and-test-itemlost-not-notfo.patch (text/plain), 3.04 KB, created by
Nick Clemens (kidclamp)
on 2022-09-13 13:08:34 UTC
(
hide
)
Description:
Bug 25375: Adjust tests and test itemlost, not notforloan
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-09-13 13:08:34 UTC
Size:
3.04 KB
patch
obsolete
>From dceb3ededd0b9451fde598fe6a5af4f3d9a3ed22 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 13 Sep 2022 13:06:03 +0000 >Subject: [PATCH] Bug 25375: Adjust tests and test itemlost, not notforloan > >Previous commit correctly lists Zebra availability test, but was a >bad edit. This fixes the availability test to use itemlost > >Additiionally, tests were written before limits were agreed. Adjusted >for the current settings >--- > Koha/SearchEngine/Elasticsearch.pm | 2 +- > t/db_dependent/Koha/SearchEngine/Elasticsearch.t | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 28dd05c2f3..1fe6fb1c6f 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -781,7 +781,7 @@ sub marc_records_to_documents { > my $avail_items = Koha::Items->search({ > biblionumber => $biblionumber, > onloan => undef, >- notforloan => 0, >+ itemlost => 0, > })->count; > > $record_document->{available} = $avail_items ? \1 : \0; >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >index d0a11d924d..6356d9c20a 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch.t >@@ -1006,7 +1006,7 @@ subtest 'marc_records_to_documents should set the "available" field' => sub { > > $item->notforloan(1)->store(); > $docs = $see->marc_records_to_documents([$marc_record_1]); >- is_deeply($docs->[0]->{available}, \0, 'a biblio with one item that is "notforloan" is not available'); >+ is_deeply($docs->[0]->{available}, \1, 'a biblio with one item that is "notforloan" is available'); > > $item->set({ notforloan => 0, onloan => '2022-03-03' })->store(); > $docs = $see->marc_records_to_documents([$marc_record_1]); >@@ -1014,7 +1014,7 @@ subtest 'marc_records_to_documents should set the "available" field' => sub { > > $item->set({ onloan => undef, withdrawn => 1 })->store(); > $docs = $see->marc_records_to_documents([$marc_record_1]); >- is_deeply($docs->[0]->{available}, \0, 'a biblio with one item that is withdrawn is not available'); >+ is_deeply($docs->[0]->{available}, \1, 'a biblio with one item that is withdrawn is available'); > > $item->set({ withdrawn => 0, itemlost => 1 })->store(); > $docs = $see->marc_records_to_documents([$marc_record_1]); >@@ -1022,7 +1022,7 @@ subtest 'marc_records_to_documents should set the "available" field' => sub { > > $item->set({ itemlost => 0, damaged => 1 })->store(); > $docs = $see->marc_records_to_documents([$marc_record_1]); >- is_deeply($docs->[0]->{available}, \0, 'a biblio with one item that is damaged is not available'); >+ is_deeply($docs->[0]->{available}, \1, 'a biblio with one item that is damaged is available'); > > my $item2 = Koha::Item->new({ > biblionumber => $biblionumber, >-- >2.30.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 25375
:
104356
|
109647
|
109659
|
109660
|
109951
|
109952
|
109953
|
109954
|
131310
|
131311
|
131312
|
131313
|
132327
|
132328
|
132329
|
132330
|
138800
|
138802
|
138803
|
140053
|
140054
|
140055
|
140056
|
140057
| 140572 |
140899
|
140900
|
140979