Bugzilla – Attachment 85491 Details for
Bug 18928
Move `holdallowed`, `hold_fulfillment_policy` and `returnbranch` into the `circulation_rules` table.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18928: Update new occurrences
Bug-18928-Update-new-occurrences.patch (text/plain), 5.62 KB, created by
Jonathan Druart
on 2019-02-21 20:28:56 UTC
(
hide
)
Description:
Bug 18928: Update new occurrences
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-02-21 20:28:56 UTC
Size:
5.62 KB
patch
obsolete
>From d4eb473ca634cbaaf6a8f70858d4a6a112dc11dc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Feb 2019 17:27:57 -0300 >Subject: [PATCH] Bug 18928: Update new occurrences > >--- > t/db_dependent/Circulation/Branch.t | 6 ----- > t/db_dependent/Circulation/SwitchOnSiteCheckouts.t | 4 --- > t/db_dependent/Circulation/TooMany.t | 4 --- > .../Holds/DisallowHoldIfItemsAvailable.t | 30 ++++++++++++++-------- > 4 files changed, 20 insertions(+), 24 deletions(-) > >diff --git a/t/db_dependent/Circulation/Branch.t b/t/db_dependent/Circulation/Branch.t >index 1c2d17a65f..dfd65d33d2 100644 >--- a/t/db_dependent/Circulation/Branch.t >+++ b/t/db_dependent/Circulation/Branch.t >@@ -176,12 +176,6 @@ Koha::CirculationRules->set_rules( > } > ); > >-$query = q| >- INSERT INTO default_circ_rules >- (singleton, holdallowed, returnbranch) >- VALUES( ?, ?, ? ) >-|; >-$dbh->do( $query, {}, 'singleton', 3, 'homebranch' ); > Koha::CirculationRules->set_rules( > { > branchcode => undef, >diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >index 7ef05ee49b..fed7bc2188 100644 >--- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >+++ b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >@@ -37,11 +37,7 @@ $schema->storage->txn_begin; > > our $dbh = C4::Context->dbh; > >-$dbh->do(q|DELETE FROM branch_item_rules|); > $dbh->do(q|DELETE FROM issues|); >-$dbh->do(q|DELETE FROM default_branch_circ_rules|); >-$dbh->do(q|DELETE FROM default_circ_rules|); >-$dbh->do(q|DELETE FROM default_branch_item_rules|); > $dbh->do(q|DELETE FROM issuingrules|); > > my $builder = t::lib::TestBuilder->new(); >diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t >index 47263a9865..72e0d1869f 100644 >--- a/t/db_dependent/Circulation/TooMany.t >+++ b/t/db_dependent/Circulation/TooMany.t >@@ -43,10 +43,6 @@ $dbh->do(q|DELETE FROM branches|); > $dbh->do(q|DELETE FROM categories|); > $dbh->do(q|DELETE FROM accountlines|); > $dbh->do(q|DELETE FROM itemtypes|); >-$dbh->do(q|DELETE FROM branch_item_rules|); >-$dbh->do(q|DELETE FROM default_branch_circ_rules|); >-$dbh->do(q|DELETE FROM default_circ_rules|); >-$dbh->do(q|DELETE FROM default_branch_item_rules|); > $dbh->do(q|DELETE FROM issuingrules|); > Koha::CirculationRules->search()->delete(); > >diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >index 0b5f2426b7..8de96f7595 100755 >--- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >+++ b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >@@ -125,8 +125,6 @@ AddReturn( $item1->{barcode} ); > > my $hold_allowed_from_home_library = 1; > my $hold_allowed_from_any_libraries = 2; >- my $sth_delete_rules = $dbh->prepare(q|DELETE FROM default_circ_rules|); >- my $sth_insert_rule = $dbh->prepare(q|INSERT INTO default_circ_rules(singleton, holdallowed, hold_fulfillment_policy, returnbranch) VALUES ('singleton', ?, 'any', 'homebranch');|); > > subtest 'Item is available at a different library' => sub { > plan tests => 4; >@@ -142,8 +140,7 @@ AddReturn( $item1->{barcode} ); > #FIXME: ReservesControlBranch is not checked in these subs we are testing > > { >- $sth_delete_rules->execute; >- $sth_insert_rule->execute( $hold_allowed_from_home_library ); >+ set_holdallowed_rule( $hold_allowed_from_home_library ); > > t::lib::Mocks::mock_preference('ReservesControlBranch', 'ItemHomeLibrary'); > $is = IsAvailableForItemLevelRequest( $item1, $borrower1); >@@ -155,8 +152,7 @@ AddReturn( $item1->{barcode} ); > } > > { >- $sth_delete_rules->execute; >- $sth_insert_rule->execute( $hold_allowed_from_any_libraries ); >+ set_holdallowed_rule( $hold_allowed_from_any_libraries ); > > t::lib::Mocks::mock_preference('ReservesControlBranch', 'ItemHomeLibrary'); > $is = IsAvailableForItemLevelRequest( $item1, $borrower1); >@@ -182,8 +178,7 @@ AddReturn( $item1->{barcode} ); > #ReservesControlBranch is not checked in these subs we are testing? > > { >- $sth_delete_rules->execute; >- $sth_insert_rule->execute( $hold_allowed_from_home_library ); >+ set_holdallowed_rule( $hold_allowed_from_home_library ); > > t::lib::Mocks::mock_preference('ReservesControlBranch', 'ItemHomeLibrary'); > $is = IsAvailableForItemLevelRequest( $item1, $borrower1); >@@ -195,8 +190,7 @@ AddReturn( $item1->{barcode} ); > } > > { >- $sth_delete_rules->execute; >- $sth_insert_rule->execute( $hold_allowed_from_any_libraries ); >+ set_holdallowed_rule( $hold_allowed_from_any_libraries ); > > t::lib::Mocks::mock_preference('ReservesControlBranch', 'ItemHomeLibrary'); > $is = IsAvailableForItemLevelRequest( $item1, $borrower1); >@@ -253,3 +247,19 @@ is( $is, 1, "Item can be held, items in transit are not available" ); > > # Cleanup > $schema->storage->txn_rollback; >+ >+sub set_holdallowed_rule { >+ my ( $holdallowed ) = @_; >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ holdallowed => $holdallowed, >+ hold_fulfillment_policy => 'any', >+ returnbranch => 'homebranch', >+ } >+ } >+ ); >+} >-- >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 18928
:
65241
|
65242
|
71005
|
71006
|
81096
|
81097
|
81098
|
81099
|
82933
|
82934
|
82935
|
82936
|
85487
|
85488
|
85489
|
85490
|
85491
|
86134
|
86135
|
86136
|
86137
|
86138
|
86139
|
88659
|
89017
|
89018
|
89019
|
89020
|
89021
|
89022
|
89023
|
89024
|
89333
|
89334
|
89336
|
89338
|
89339
|
89340
|
89341
|
89342
|
89343
|
89344
|
89345
|
89346
|
89347
|
89348
|
89349
|
89377
|
89402
|
89427
|
89428
|
89429
|
89430
|
89431
|
89432
|
89433
|
89434
|
89435
|
89436
|
89437
|
89438
|
89440
|
89441
|
89442
|
89443
|
89444
|
89445
|
89446
|
89447
|
89448
|
89449
|
89450
|
89451
|
89628
|
89629
|
89630
|
89631
|
89632
|
89633
|
89634
|
89635
|
89636
|
89637
|
89638
|
90501
|
91082
|
91083
|
91084
|
91085
|
91086
|
91087
|
91088
|
91089
|
91090
|
91091
|
91092
|
91093
|
91094