Bugzilla – Attachment 143619 Details for
Bug 31692
Let librarians change item level holds to record level holds when possible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31692: (follow-up) Adjust reserves.item_level_hold
Bug-31692-follow-up-Adjust-reservesitemlevelhold.patch (text/plain), 2.53 KB, created by
Lari Taskula
on 2022-11-10 02:29:24 UTC
(
hide
)
Description:
Bug 31692: (follow-up) Adjust reserves.item_level_hold
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2022-11-10 02:29:24 UTC
Size:
2.53 KB
patch
obsolete
>From e3743bc11c01962475be0e3b53cbebb985f9e9ea Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Thu, 3 Nov 2022 20:50:33 +0000 >Subject: [PATCH] Bug 31692: (follow-up) Adjust reserves.item_level_hold > >Original patch missed handling reserves.item_level_hold column. > >To test: >1. prove t/db_dependent/Koha/Hold.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Hold.pm | 5 ++++- > t/db_dependent/Koha/Hold.t | 11 ++++++++++- > 2 files changed, 14 insertions(+), 2 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 1d386bdeb6..e34fe1881f 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -869,7 +869,10 @@ sub change_type { > } > > if ( $record_holds_per_patron->count == 1 ) { >- $self->set({ itemnumber => $itemnumber ? $itemnumber : undef })->store; >+ $self->set({ >+ itemnumber => $itemnumber ? $itemnumber : undef, >+ item_level_hold => $itemnumber ? 1 : 0, >+ })->store; > } else { > Koha::Exceptions::Hold::CannotChangeHoldType->throw(); > } >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index 0c9a073611..b1f11dc42b 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -958,7 +958,7 @@ subtest 'Koha::Hold::item_group tests' => sub { > > subtest 'change_type tests' => sub { > >- plan tests => 9; >+ plan tests => 13; > > $schema->storage->txn_begin; > >@@ -967,6 +967,7 @@ subtest 'change_type tests' => sub { > class => 'Koha::Holds', > value => { > itemnumber => undef, >+ item_level_hold => 0, > } > } ); > >@@ -983,24 +984,32 @@ subtest 'change_type tests' => sub { > > is( $hold->itemnumber, undef, 'record hold to record hold, no changes'); > >+ is( $hold->item_level_hold, 0, 'item_level_hold=0' ); >+ > ok( $hold->change_type( $item->itemnumber ) ); > > $hold->discard_changes; > > is( $hold->itemnumber, $item->itemnumber, 'record hold to item hold'); > >+ is( $hold->item_level_hold, 1, 'item_level_hold=1' ); >+ > ok( $hold->change_type( $item->itemnumber ) ); > > $hold->discard_changes; > > is( $hold->itemnumber, $item->itemnumber, 'item hold to item hold, no changes'); > >+ is( $hold->item_level_hold, 1, 'item_level_hold=1' ); >+ > ok( $hold->change_type ); > > $hold->discard_changes; > > is( $hold->itemnumber, undef, 'item hold to record hold'); > >+ is( $hold->item_level_hold, 0, 'item_level_hold=0' ); >+ > my $hold3 = $builder->build_object( { > class => 'Koha::Holds', > value => { >-- >2.25.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 31692
:
141388
|
141390
|
142102
|
142103
|
142104
|
142106
|
142107
|
142108
|
142109
|
142114
|
142115
|
142116
|
142117
|
142118
|
142586
|
142587
|
142595
|
142596
|
142818
|
142819
|
143151
|
143160
|
143161
|
143162
|
143614
|
143615
|
143616
|
143617
|
143618
|
143619
|
143627
|
143628
|
143629