Bugzilla – Attachment 94528 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 C4::Items::GetItemsInfo
Bug-23233-Remove-use-of-AllowItemsOnHoldCheckout-f.patch (text/plain), 3.17 KB, created by
Joonas Kylmälä
on 2019-10-22 11:33:15 UTC
(
hide
)
Description:
Bug 23233: Remove use of AllowItemsOnHoldCheckout from C4::Items::GetItemsInfo
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2019-10-22 11:33:15 UTC
Size:
3.17 KB
patch
obsolete
>From d6d4c7405e0c43a232a97d09e59124d89459e43e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 1 Jul 2019 08:56:09 -0400 >Subject: [PATCH] Bug 23233: Remove use of AllowItemsOnHoldCheckout from > C4::Items::GetItemsInfo >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> >--- > C4/Items.pm | 9 +++------ > t/db_dependent/Items.t | 10 ++++------ > 2 files changed, 7 insertions(+), 12 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 15e4fd94d7..b58b8cad71 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -948,10 +948,8 @@ sub GetItemsInfo { > holding.branchcode, > holding.branchname, > holding.opac_info as holding_branch_opac_info, >- home.opac_info as home_branch_opac_info >- "; >- $query .= ",IF(tmp_holdsqueue.itemnumber,1,0) AS has_pending_hold" if !C4::Context->preference('AllowItemsOnHoldCheckoutSIP'); >- $query .= " >+ home.opac_info as home_branch_opac_info, >+ IF(tmp_holdsqueue.itemnumber,1,0) AS has_pending_hold > FROM items > LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode > LEFT JOIN branches AS home ON items.homebranch=home.branchcode >@@ -963,9 +961,8 @@ sub GetItemsInfo { > LEFT JOIN serial USING (serialid) > LEFT JOIN itemtypes ON itemtypes.itemtype = " > . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); >- $query .= " >- LEFT JOIN tmp_holdsqueue USING (itemnumber)" if !C4::Context->preference('AllowItemsOnHoldCheckoutSIP'); > $query .= q| >+ LEFT JOIN tmp_holdsqueue USING (itemnumber) > LEFT JOIN localization ON itemtypes.itemtype = localization.code > AND localization.entity = 'itemtypes' > AND localization.lang = ? >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index bbed0436b6..401c881735 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -313,18 +313,16 @@ subtest 'GetItemsInfo tests' => sub { > is( $results[0]->{ restrictedvalueopac }, "Restricted Access OPAC", > 'GetItemsInfo returns a restricted value description (OPAC)' ); > >- t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 0 ); > #place item into holds queue > my $dbh = C4::Context->dbh; >+ @results = GetItemsInfo( $biblio->biblionumber ); >+ is( $results[0]->{ has_pending_hold }, "0", >+ 'Hold not marked as pending/unavailable if nothing in tmp_holdsqueue for item' ); >+ > $dbh->do(q{INSERT INTO tmp_holdsqueue (biblionumber, itemnumber, surname, borrowernumber ) VALUES (?, ?, "Zorro", 42)}, undef, $item_bibnum, $itemnumber); > @results = GetItemsInfo( $biblio->biblionumber ); > is( $results[0]->{ has_pending_hold }, "1", > 'Hold marked as pending/unavailable if not AllowItemsOnHoldCheckout' ); >- t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckout', 1 ); >- @results = GetItemsInfo( $biblio->biblionumber ); >- is( $results[0]->{ has_pending_hold }, undef, >- 'Hold not marked as pending/unavailable if AllowItemsOnHoldCheckout' ); >- > > $schema->storage->txn_rollback; > }; >-- >2.17.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 23233
:
91114
|
91139
|
91143
|
91144
|
94526
|
94527
|
94528
|
94529
|
94530
|
94531
|
94556
|
94557
|
94558
|
96247
|
96248
|
96249
|
96250
|
96251
|
96252
|
96345
|
96358