Bugzilla – Attachment 69816 Details for
Bug 4319
waiting and in transit items cannot be reserved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4319: (QA follow-up) Consistency in IsAvailableForItemLevelRequest
Bug-4319-QA-follow-up-Consistency-in-IsAvailableFo.patch (text/plain), 2.40 KB, created by
Marcel de Rooy
on 2017-12-15 10:26:08 UTC
(
hide
)
Description:
Bug 4319: (QA follow-up) Consistency in IsAvailableForItemLevelRequest
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-12-15 10:26:08 UTC
Size:
2.40 KB
patch
obsolete
>From 137f94104208683c4e7507391fa8ce7703768418 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 15 Dec 2017 10:09:29 +0100 >Subject: [PATCH] Bug 4319: (QA follow-up) Consistency in > IsAvailableForItemLevelRequest >Content-Type: text/plain; charset=utf-8 > >[1] For consistency going back to IsItemOnHoldAndFound in this sub. > This call is used in the on_shelf_holds == 2 case too. > The routine will be refactored quite soon. > Adding the else branch for on_shelf_holds == 0 for more clarity. >[2] Removing the test for found==F in reserves. In Koha F is only used > when the hold is filled and moved to oldreserves. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Reserves.pm | 13 ++----------- > t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t | 7 +------ > 2 files changed, 3 insertions(+), 17 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 7ceaaf2..e6a5f80 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1143,18 +1143,9 @@ sub IsAvailableForItemLevelRequest { > } > > return $any_available ? 0 : 1; >+ } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) >+ return $item->{onloan} || IsItemOnHoldAndFound( $item->{itemnumber} ); > } >- >- if ($item->{onloan}) { >- return 1; >- } >- >- if ( Koha::Holds->search({itemnumber => $item->{itemnumber}, >- found => ['W', 'T']})->count ) { >- return 1; >- } >- >- return 0; > } > > =head2 OnShelfHoldsAllowed >diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >index 3abba34..1a9edd8 100755 >--- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >+++ b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >@@ -7,7 +7,7 @@ use C4::Items; > use C4::Circulation; > use Koha::IssuingRule; > >-use Test::More tests => 7; >+use Test::More tests => 6; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -255,10 +255,5 @@ $rule->store(); > $is = IsAvailableForItemLevelRequest( $item3, $borrower1); > is( $is, 1, "Item can be held, items in transit are not available" ); > >-Koha::Holds->find($hold->{reserve_id})->found('F')->store; >- >-$is = IsAvailableForItemLevelRequest( $item3, $borrower1); >-is( $is, 0, "Item is neither waiting nor in transit." ); >- > # Cleanup > $schema->storage->txn_rollback; >-- >2.1.4
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 4319
:
3740
|
4099
|
4110
|
4327
|
4329
|
16965
|
67558
|
67584
|
67637
|
67704
|
67970
|
68194
|
68197
|
68198
|
68199
|
68531
|
68782
|
68786
|
69724
|
69725
|
69728
|
69815
| 69816 |
69817
|
70457