Bugzilla – Attachment 125975 Details for
Bug 3142
Standardize how OPAC and staff determine requestability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3142: (QA follow-up) Include notforloan itemtypes
Bug-3142-QA-follow-up-Include-notforloan-itemtypes.patch (text/plain), 2.64 KB, created by
Nick Clemens (kidclamp)
on 2021-10-08 14:31:52 UTC
(
hide
)
Description:
Bug 3142: (QA follow-up) Include notforloan itemtypes
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-08 14:31:52 UTC
Size:
2.64 KB
patch
obsolete
>From bb46330dba551086c800686fdac7d781b54fa5dd Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 8 Oct 2021 09:10:22 +0000 >Subject: [PATCH] Bug 3142: (QA follow-up) Include notforloan itemtypes > >As was done in the code already. >Note that we are ignoring effective itemtype now. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Items.pm | 1 + > t/db_dependent/Koha/Items.t | 18 ++++++++++++++++-- > 2 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index 629a2147cd..ece4b86659 100644 >--- a/Koha/Items.pm >+++ b/Koha/Items.pm >@@ -61,6 +61,7 @@ sub filter_by_for_hold { > rule_value => 'not_allowed', > } > )->get_column('itemtype'); >+ push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); > > return $self->search( > { >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 80e2b7b604..9a951d7e4f 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -1510,7 +1510,7 @@ subtest 'can_be_transferred' => sub { > }; > > subtest 'filter_by_for_hold' => sub { >- plan tests => 9; >+ plan tests => 11; > > my $biblio = $builder->build_sample_biblio; > is( $biblio->items->filter_by_for_hold->count, 0, 'no item yet' ); >@@ -1536,7 +1536,8 @@ subtest 'filter_by_for_hold' => sub { > t::lib::Mocks::mock_preference('AllowHoldsOnDamagedItems', 1); > is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - damaged if AllowHoldsOnDamagedItems' ); > >- my $not_holdable_itemtype = $builder->build_object({ class => 'Koha::ItemTypes' })->itemtype; >+ my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); >+ my $not_holdable_itemtype = $itemtype->itemtype; > $builder->build_sample_item( > { > biblionumber => $biblio->biblionumber, >@@ -1553,6 +1554,19 @@ subtest 'filter_by_for_hold' => sub { > ); > is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - holdallowed=not_allowed' ); > >+ # Remove rule, test notforloan on itemtype >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => undef, >+ itemtype => $not_holdable_itemtype, >+ rule_name => 'holdallowed', >+ rule_value => undef, >+ } >+ ); >+ is( $biblio->items->filter_by_for_hold->count, 7, '7 items for hold - rule deleted' ); >+ $itemtype->notforloan(1)->store; >+ is( $biblio->items->filter_by_for_hold->count, 6, '6 items for hold - notforloan' ); >+ > $biblio->delete; > }; > >-- >2.20.1
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 3142
:
122284
|
122285
|
122286
|
122287
|
122314
|
122315
|
122316
|
122317
|
125727
|
125728
|
125729
|
125730
|
125732
|
125733
|
125734
|
125942
|
125943
|
125944
|
125945
|
125946
|
125947
|
125948
|
125949
|
125950
|
125951
|
125956
|
125967
|
125968
|
125969
|
125970
|
125971
|
125972
|
125973
|
125974
| 125975 |
125976
|
125977