Bugzilla – Attachment 182160 Details for
Bug 39866
Acquisitions statistics fails when filling only the To date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39866: Acquisitions statistics fails when filling only the To date
Bug-39866-Acquisitions-statistics-fails-when-filli.patch (text/plain), 2.73 KB, created by
Adolfo RodrÃguez Taboada
on 2025-05-09 09:01:34 UTC
(
hide
)
Description:
Bug 39866: Acquisitions statistics fails when filling only the To date
Filename:
MIME Type:
Creator:
Adolfo RodrÃguez Taboada
Created:
2025-05-09 09:01:34 UTC
Size:
2.73 KB
patch
obsolete
>From c99127601736191844e615765a998cdc19429702 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= <adolfo.rodriguez@xercode.es> >Date: Fri, 9 May 2025 11:00:22 +0200 >Subject: [PATCH] Bug 39866: Acquisitions statistics fails when filling only > the To date > >This patch fixes the exection of the report Acquisitions statistics if you fill only the To date >Test plan: >1 Execute the report Acquisitions statistics filling only To date filter in Placed on or Received on (/cgi-bin/koha/reports/acquisitions_stats.pl) Koha returns an Internal Server Error >2 Apply patch, restart services >3 Repeat step 1, now the report returns the results page as expected >--- > reports/acquisitions_stats.pl | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl >index 4457e56f24..4c86335792 100755 >--- a/reports/acquisitions_stats.pl >+++ b/reports/acquisitions_stats.pl >@@ -285,7 +285,7 @@ sub calculate { > LEFT JOIN biblioitems ON (aqorders.biblionumber = biblioitems.biblionumber) > LEFT JOIN aqbudgets ON (aqorders.budget_id = aqbudgets.budget_id ) > LEFT JOIN aqbooksellers ON (aqbasket.booksellerid = aqbooksellers.id) >- WHERE $line IS NOT NULL AND $line <> '' "; >+ WHERE $line IS NOT NULL AND COALESCE($line,'') <> '' "; > > if (@linefilter) { > if ( $linefilter[1] ) { >@@ -310,10 +310,12 @@ sub calculate { > $strsth .= " ORDER BY $line"; > > my $sth = $dbh->prepare($strsth); >- if ( (@linefilter) and ( $linefilter[1] ) ) { >+ if ( (@linefilter) and ( $linefilter[0] && $linefilter[1] ) ) { > $sth->execute( $linefilter[0], $linefilter[1] ); > } elsif ( $linefilter[0] ) { > $sth->execute( $linefilter[0] ); >+ } elsif ( $linefilter[1] ) { >+ $sth->execute( $linefilter[1] ); > } else { > $sth->execute; > } >@@ -336,7 +338,7 @@ sub calculate { > LEFT JOIN biblioitems ON (aqorders.biblionumber = biblioitems.biblionumber) > LEFT JOIN aqbudgets ON (aqorders.budget_id = aqbudgets.budget_id ) > LEFT JOIN aqbooksellers ON (aqbasket.booksellerid = aqbooksellers.id) >- WHERE $column IS NOT NULL AND $column <> '' >+ WHERE $column IS NOT NULL AND COALESCE($column,'') <> '' > "; > > if (@colfilter) { >@@ -364,10 +366,12 @@ sub calculate { > > my $sth2 = $dbh->prepare($strsth2); > >- if ( (@colfilter) and ( $colfilter[1] ) ) { >+ if ( (@colfilter) and ( $colfilter[0] and $colfilter[1] ) ) { > $sth2->execute( $colfilter[0], $colfilter[1] ); > } elsif ( $colfilter[0] ) { > $sth2->execute( $colfilter[0] ); >+ } elsif ( $colfilter[1] ) { >+ $sth2->execute( $colfilter[1] ); > } else { > $sth2->execute; > } >-- >2.30.2
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 39866
:
182160
|
182227
|
182854
|
182855