Bugzilla – Attachment 185162 Details for
Bug 39802
Add CircControl equivalent system preference for lost item fees and actions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39802: Report when no branches will be selected and exit
Bug-39802-Report-when-no-branches-will-be-selected.patch (text/plain), 1.97 KB, created by
Nick Clemens (kidclamp)
on 2025-08-06 15:22:30 UTC
(
hide
)
Description:
Bug 39802: Report when no branches will be selected and exit
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-08-06 15:22:30 UTC
Size:
1.97 KB
patch
obsolete
>From c00e26830fc627251da5950c375813223d4b95db Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Aug 2025 15:20:29 +0000 >Subject: [PATCH] Bug 39802: Report when no branches will be selected and exit > >This highlights the issue mentioned in the last patch, reporting that >nothign will be done and exiting the script > >To test: >1 - perl misc/cronjobs/longoverdue.pl -l 5=1 --library CPL >2 - Confirm script exits with warning that nothing has been done >--- > misc/cronjobs/longoverdue.pl | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl >index e41862306d7..c8c863dbb4d 100755 >--- a/misc/cronjobs/longoverdue.pl >+++ b/misc/cronjobs/longoverdue.pl >@@ -106,6 +106,21 @@ if ( scalar @branches && scalar @skip_branches ) { > ); > } > >+my $lost_control_pref = C4::Context->preference('LostChargesControl'); >+my $home_holding_pref = C4::Context->preference('HomeOrHoldingBranch'); >+if ( ( scalar @branches || scalar @skip_branches ) >+ && $lost_control_pref eq 'PickupLibrary' >+ && !( C4::Context->userenv->{branch} ) ) >+{ >+ pod2usage( >+ -verbose => 0, >+ -message => >+ "There is no branch set for the cron user, LostCharge Control is set to 'library you are logged in at'.\n" >+ . "No branches will satisfy this requirement - exiting.", >+ -exitval => 1 >+ ); >+} >+ > if ( scalar @$itemtype && scalar @$skip_itemtype ) { > pod2usage( > -verbose => 1, >@@ -359,9 +374,7 @@ sub longoverdue_sth { > return C4::Context->dbh->prepare($query); > } > >-my $dbh = C4::Context->dbh; >-my $lost_control_pref = C4::Context->preference('LostChargesControl'); >-my $home_holding_pref = C4::Context->preference('HomeOrHoldingBranch'); >+my $dbh = C4::Context->dbh; > > my @available_categories = Koha::Patron::Categories->search()->get_column('categorycode'); > $borrower_category = [ map { uc $_ } @$borrower_category ]; >-- >2.39.5
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 39802
:
185160
|
185161
| 185162 |
185165