Bugzilla – Attachment 70473 Details for
Bug 19938
C4::Overdues::checkoverdues has inconsistent return type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19938: Refactor checkoverdues
Bug-19938-Refactor-checkoverdues.patch (text/plain), 3.57 KB, created by
Mark Tompsett
on 2018-01-12 16:16:02 UTC
(
hide
)
Description:
Bug 19938: Refactor checkoverdues
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-01-12 16:16:02 UTC
Size:
3.57 KB
patch
obsolete
>From e6c143f6477c862d3463b521805814d8791f258f Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 9 Jan 2018 15:08:23 +0000 >Subject: [PATCH] Bug 19938: Refactor checkoverdues > >TEST PLAN >--------- >0) back up plack error log if you care. > >1) Run these on your kohadevbox: > echo | sudo tee /var/log/koha/kohadev/plack-error.log > sudo koha-shell -c bash kohadev > prove t/db_dependent/Circulation/dateexpiry.t > prove t/db_dependent/www/search_utf8.t > ./misc/cronjobs/staticfines.pl > exit > > They will all pass or run without error. > However, the log file will have noise. > >2) Run these on your kohadevbox: > git bz apply 19938 > restart_all > echo | sudo tee /var/log/koha/kohadev/plack-error.log > sudo koha-shell -c bash kohadev > prove t/db_dependent/Circulation/dateexpiry.t > prove t/db_dependent/www/search_utf8.t > ./misc/cronjobs/staticfines.pl > exit > > They will all pass or run without error. > This time the log file will have no noise. > >3) run koha qa test tools > >Signed-off-by: Lee Jamison <ldjamison@marywood.edu> >--- > C4/Overdues.pm | 8 ++++---- > misc/cronjobs/staticfines.pl | 4 ++-- > opac/opac-main.pl | 3 ++- > 3 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 6b75e38..aaac23d 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -145,9 +145,10 @@ LEFT JOIN biblioitems USING (biblioitemnumber) > > =head2 checkoverdues > >- ($count, $overdueitems) = checkoverdues($borrowernumber); >+ my $overdueitems = checkoverdues($borrowernumber); >+ my $count = $overdueitems ? scalar(@$overdueitems) : 0; > >-Returns a count and a list of overdueitems for a given borrowernumber >+Returns a list of overdueitems for a given borrowernumber > > =cut > >@@ -190,8 +191,7 @@ sub checkoverdues { > AND issues.date_due < NOW()" > ); > $sth->execute($borrowernumber); >- my $results = $sth->fetchall_arrayref({}); >- return ( scalar(@$results), $results); # returning the count and the results is silly >+ return $sth->fetchall_arrayref({}); > } > > =head2 CalcFine >diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl >index c57e99e..73aafcb 100755 >--- a/misc/cronjobs/staticfines.pl >+++ b/misc/cronjobs/staticfines.pl >@@ -128,11 +128,11 @@ INIT { > $debug and (defined $borrowernumberlimit) and print "--borrower limitation: borrower $borrowernumberlimit\n"; > my ($numOverdueItems, $data); > if (defined $borrowernumberlimit) { >- ($numOverdueItems, $data) = checkoverdues($borrowernumberlimit); >+ $data = checkoverdues($borrowernumberlimit); > } else { > $data = Getoverdues(); >- $numOverdueItems = scalar @$data; > } >+$numOverdueItems = $data ? scalar(@$data) : 0; > my $overdueItemsCounted = 0; > my %calendars = (); > $today = dt_from_string; >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index 33e100f..adc82a3 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -68,7 +68,8 @@ my $quote = GetDailyQuote(); # other options are to pass in an exact quote id > > # For dashboard > my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; >-my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); >+my $overdues = checkoverdues($borrowernumber); >+my $overdues_count = $overdues ? scalar(@$overdues) : 0; > my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; > my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; > my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); >-- >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 19938
:
70375
|
70382
|
70383
|
70396
|
70397
|
70472
|
70473
|
70485
|
70486
|
70489
|
70567