Bugzilla – Attachment 48575 Details for
Bug 12803
Add ability to skip closed libraries when generating the holds queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12803 [QA Followup] - Allow holiday caching to be disabled for testing purposes
Bug-12803-QA-Followup---Allow-holiday-caching-to-b.patch (text/plain), 5.38 KB, created by
Mark Tompsett
on 2016-03-03 04:10:33 UTC
(
hide
)
Description:
Bug 12803 [QA Followup] - Allow holiday caching to be disabled for testing purposes
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-03-03 04:10:33 UTC
Size:
5.38 KB
patch
obsolete
>From 72eb44ea854749e9808fce69bd6f8ab5376d8a60 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 16 Oct 2015 09:53:51 -0400 >Subject: [PATCH] Bug 12803 [QA Followup] - Allow holiday caching to be > disabled for testing purposes > >Bug 12803 [QA Followup] - Remove use of C4::Dates > >C4::Dates was being included, but not used in the code! > >Bug 12803 [QA Followup] - Fix koha-qa.pl errors > >Bug 12803 [QA Followup] - Update unit tests due to changes in master > >Bug 12803 [QA Followup] - Fix to stop failing unit tests > >Bug 12803 [QA Followup] - Remove duplicate 'use' lines > >Bug 12803 [QA Followup] - Remove NO_CACHE > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/HoldsQueue.pm | 1 - > installer/data/mysql/sysprefs.sql | 2 +- > t/db_dependent/HoldsQueue.t | 17 +++++++++-------- > 3 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 3b92f9b..3cfe206 100755 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -29,7 +29,6 @@ use C4::Branch; > use C4::Circulation; > use C4::Members; > use C4::Biblio; >-use C4::Dates qw/format_date/; > use Koha::DateUtils; > > use List::Util qw(shuffle); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index daadfd2..fe4018a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -159,8 +159,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'), > ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch\'s items to emphasize. If PatronBranch, emphasize the logged in user\'s library\'s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha\'s Apache configuration file.','Choice'), > ('HoldFeeMode','not_always','always|not_always','Set the hold fee mode','Choice'), >-('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'), > ('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'), >+('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'), > ('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'), > ('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'), > ('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'), >diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t >index 3da5dbb..f0141fb 100755 >--- a/t/db_dependent/HoldsQueue.t >+++ b/t/db_dependent/HoldsQueue.t >@@ -8,19 +8,16 @@ > > use Modern::Perl; > >-use Test::More tests => 24; >+use Test::More tests => 26; > use Data::Dumper; > > use C4::Branch; >-use C4::Members; >-use Koha::Database; >- > use C4::Calendar; > use C4::Context; >-use C4::Branch; >-use C4::ItemType; > use C4::Members; >+use Koha::Database; > use Koha::DateUtils; >+use Koha::ItemType; > > use t::lib::TestBuilder; > >@@ -312,13 +309,16 @@ is( $holds_queue->[1]->{cardnumber}, $borrower2->{cardnumber}, "Holds queue fill > # have 1 row in the holds queue > C4::Context->set_preference('HoldsQueueSkipClosed', 1); > my $today = dt_from_string(); >-C4::Calendar->new( branchcode => 'MPL' )->insert_single_holiday( >+C4::Calendar->new( branchcode => $branchcodes[0] )->insert_single_holiday( > day => $today->day(), > month => $today->month(), > year => $today->year(), > title => "$today", > description => "$today", > ); >+# If the test below is removed, aother tests using the holiday will fail. For some reason if we call is_holiday now >+# the holiday will get set in cache correctly, but not if we let C4::HoldsQueue call is_holiday instead. >+is( Koha::Calendar->new( branchcode => $branchcodes[0] )->is_holiday( $today ), 1, 'Is today a holiday for pickup branch' ); > C4::HoldsQueue::CreateQueue(); > $holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); > is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" ); >@@ -333,12 +333,13 @@ is( @$holds_queue, 3, "Holds queue filling correct number for holds for default > # Test skipping hold picks for closed libraries without transport cost matrix > # At this point in the test, we have 3 rows in the holds queue > # one of which is coming from MPL. Let's enable HoldsQueueSkipClosed >-# and use our previously created holiday for MPL. >+# and use our previously created holiday for MPL > # When we run it again we should only have 2 rows in the holds queue > C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 ); > C4::HoldsQueue::CreateQueue(); > $holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} }); > is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" ); >+C4::Context->set_preference( 'HoldsQueueSkipClosed', 0 ); > > # Bug 14297 > $itemtype = Koha::ItemTypes->search->next->itemtype; >-- >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 12803
:
31057
|
31060
|
31061
|
31062
|
31063
|
31630
|
31631
|
32046
|
32271
|
43509
|
43510
|
43511
|
43512
|
43610
|
43779
|
43833
|
43979
|
45569
|
45570
|
45571
|
45572
|
45573
|
45574
|
45575
|
45576
|
45638
|
45643
|
45644
|
46888
|
46889
|
46890
|
46891
|
46892
|
46893
|
46894
|
46895
|
47246
|
47247
|
48574
| 48575