From 0ebc5a78d9ceba0d7f7cf6ab28fd9d2faa566c9b Mon Sep 17 00:00:00 2001 From: Matthias Le Gac Date: Fri, 1 Mar 2024 14:17:20 -0500 Subject: [PATCH] Bug 35169: Resolve the override situations Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- misc/cronjobs/longoverdue.pl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 06cd6b2830..1eda9ccdc7 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -173,12 +173,14 @@ If not provided, the value of the system preference 'MarkLostItemsAsReturned' wi Act on the listed borrower category code (borrowers.categorycode). Exclude all others. This may be specified multiple times to include multiple categories. May not be used with B<--skip-category> +If not provided, the value of the system preference 'DefaultLongOverdueBorrowerCategories' will be used. =item B<--skip-category> Act on all available borrower category codes, except those listed. This may be specified multiple times, to exclude multiple categories. May not be used with B<--category> +If not provided, the value of the system preference 'DefaultLongOverdueSkipBorrowerCategories' will be used. =item B<--list-categories> @@ -276,14 +278,18 @@ if ( ! defined($charge) ) { } } -if ( C4::Context->preference('DefaultLongOverdueBorrowerCategories') ) { - my $categories = C4::Context->preference('DefaultLongOverdueBorrowerCategories'); - $borrower_category = [ split( ',', $categories ) ]; +if ( scalar @$borrower_category == 0 ) { + if ( C4::Context->preference('DefaultLongOverdueBorrowerCategories') ) { + my $categories = C4::Context->preference('DefaultLongOverdueBorrowerCategories'); + $borrower_category = [ split( ',', $categories ) ]; + } } -if ( C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories') ) { - my $categories = C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories'); - $skip_borrower_category = [ split( ',', $categories ) ]; +if ( scalar @$skip_borrower_category == 0 ) { + if ( C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories') ) { + my $categories = C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories'); + $skip_borrower_category = [ split( ',', $categories ) ]; + } } unless ($confirm) { -- 2.39.5