From d317cf1d3af9b69c2ef99f796a3927ab0c41e240 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 25 Apr 2022 14:41:33 +0000 Subject: [PATCH] Bug 14364: Fix spelling and tests Moved the installer to pl file Adjusted capitalization / reply-to Fix tests by importing needed fuction and adjusting a wrong call --- Koha/Hold.pm | 2 +- .../mysql/atomicupdate/{bug_14364.perl => bug_14364.pl} | 6 +++--- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/circulation.pref | 2 +- t/db_dependent/Holds/ExpireReservesAutoFill.t | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) rename installer/data/mysql/atomicupdate/{bug_14364.perl => bug_14364.pl} (88%) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index 540803fa4b..cee276d1e2 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -619,7 +619,7 @@ sub cancel { my $is_transfer = $self->branchcode ne $next_hold->{branchcode}; C4::Reserves::ModReserveAffect( $self->itemnumber, $self->borrowernumber, $is_transfer, $next_hold->{reserve_id}, $self->desk_id, $autofill_next ); - C4::Reserves::ModItemTransfer( $self->itemnumber, $self->branchcode, $next_hold->{branchcode}, "Reserve" ) if $is_transfer; + C4::Items::ModItemTransfer( $self->itemnumber, $self->branchcode, $next_hold->{branchcode}, "Reserve" ) if $is_transfer; } } diff --git a/installer/data/mysql/atomicupdate/bug_14364.perl b/installer/data/mysql/atomicupdate/bug_14364.pl similarity index 88% rename from installer/data/mysql/atomicupdate/bug_14364.perl rename to installer/data/mysql/atomicupdate/bug_14364.pl index 5a8b657c64..76a0b3ddfc 100644 --- a/installer/data/mysql/atomicupdate/bug_14364.perl +++ b/installer/data/mysql/atomicupdate/bug_14364.pl @@ -9,13 +9,13 @@ return { $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'), - ('ExpireReservesAutoFillEmail','', NULL,'. Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply to address','Free'); + ('ExpireReservesAutoFillEmail','', NULL,'. Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'); }); say $out "Added ExpireReservesAutoFill system preferences"; $dbh->do(q{ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) - VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled Hold Available for Different Patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <> (<>) has changed to <> <> (<>). + VALUES ( 'reserves', 'HOLD_CHANGED', '', 'Canceled hold available for different patron', '0', 'Canceled Hold Available for Different Patron', 'The patron picking up <> (<>) has changed to <> <> (<>). Please update the hold information for this item. @@ -26,4 +26,4 @@ Pickup location: <>', 'email'); }); say $out "Added HOLD_CHANGED notice"; }, -} +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 0993af7c65..912a5d2d47 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -208,7 +208,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'), ('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'), ('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'), -('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply to address','Free'), +('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'), ('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'), ('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'), ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 7047de95d3..b46aea06d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -747,7 +747,7 @@ Circulation: - automatically fill the next hold using the item. - Send email notification of the new hold filled with a canceled item to - pref: ExpireReservesAutoFillEmail - - . If no address is defined here, the email will be sent to the library's reply to address. + - . If no address is defined here, the email will be sent to the library's reply-to address. - '
NOTE: These system preferences require the misc/cronjobs/holds/cancel_expired_holds.pl cronjob. Ask your system administrator to schedule it.
' - - If using ExpireReservesMaxPickUpDelay, charge a patron who allows their waiting hold to expire a fee of diff --git a/t/db_dependent/Holds/ExpireReservesAutoFill.t b/t/db_dependent/Holds/ExpireReservesAutoFill.t index d805c50029..ab1eaf3c0f 100755 --- a/t/db_dependent/Holds/ExpireReservesAutoFill.t +++ b/t/db_dependent/Holds/ExpireReservesAutoFill.t @@ -12,6 +12,7 @@ use MARC::Record; use C4::Context; use C4::Biblio; use C4::Items; +use C4::Reserves qw(CancelExpiredReserves); use Koha::Database; use Koha::Holds; @@ -176,7 +177,7 @@ subtest 'Test automatically canceled expired waiting holds to fill the next hold CancelExpiredReserves(); - my @holds = Koha::Holds->search( {}, { order_by => 'priority' } ); + my @holds = Koha::Holds->search( {}, { order_by => 'priority' } )->as_list; $hold_2 = $holds[0]; is( @holds, 1, 'Found 1 hold' ); -- 2.30.2