Bugzilla – Attachment 96248 Details for
Bug 23233
AllowItemsOnHoldCheckout is misnamed and should only work for for SIP-based checkouts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23233: Remove use of AllowItemsOnHoldCheckout from Koha::Item::has_pending_hold, it can cause false data to be returned
Bug-23233-Remove-use-of-AllowItemsOnHoldCheckout-f.patch (text/plain), 2.30 KB, created by
Jonathan Druart
on 2019-12-13 14:25:26 UTC
(
hide
)
Description:
Bug 23233: Remove use of AllowItemsOnHoldCheckout from Koha::Item::has_pending_hold, it can cause false data to be returned
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-13 14:25:26 UTC
Size:
2.30 KB
patch
obsolete
>From 41281d3f37bee89620bd9f91fef0bff747cd51b0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 1 Jul 2019 07:19:33 -0400 >Subject: [PATCH] Bug 23233: Remove use of AllowItemsOnHoldCheckout from > Koha::Item::has_pending_hold, it can cause false data to be returned >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/Item.pm | 2 +- > t/db_dependent/Koha/Item.t | 6 +----- > 2 files changed, 2 insertions(+), 6 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index cfdef805be..b557c95abb 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -382,7 +382,7 @@ This method checks the tmp_holdsqueue to see if this item has been selected for > sub has_pending_hold { > my ( $self ) = @_; > my $pending_hold = $self->_result->tmp_holdsqueues; >- return !C4::Context->preference('AllowItemsOnHoldCheckoutSIP') && $pending_hold->count ? 1: 0; >+ return $pending_hold->count ? 1: 0; > } > > =head3 as_marc_field >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index b9ff871097..d647a24e40 100644 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -66,7 +66,7 @@ subtest 'hidden_in_opac() tests' => sub { > > subtest 'has_pending_hold() tests' => sub { > >- plan tests => 3; >+ plan tests => 2; > > $schema->storage->txn_begin; > >@@ -75,12 +75,8 @@ subtest 'has_pending_hold() tests' => sub { > my $itemnumber = $item->itemnumber; > > # disable AllowItemsOnHoldCheckout as it ignores pending holds >- t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); > $dbh->do("INSERT INTO tmp_holdsqueue (surname,borrowernumber,itemnumber) VALUES ('Clamp',42,$itemnumber)"); > ok( $item->has_pending_hold, "Yes, we have a pending hold"); >- t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 1 ); >- ok( !$item->has_pending_hold, "We don't consider a pending hold if hold items can be checked out"); >- t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); > $dbh->do("DELETE FROM tmp_holdsqueue WHERE itemnumber=$itemnumber"); > ok( !$item->has_pending_hold, "We don't have a pending hold if nothing in the tmp_holdsqueue"); > >-- >2.11.0
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 23233
:
91114
|
91139
|
91143
|
91144
|
94526
|
94527
|
94528
|
94529
|
94530
|
94531
|
94556
|
94557
|
94558
|
96247
| 96248 |
96249
|
96250
|
96251
|
96252
|
96345
|
96358