https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39866
Bug ID: 39866
Summary: Acquisitions statistics fails when filling only the To
date
Change sponsored?: ---
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Reports
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
The Acquisitions statistics returns an Internal Server Error if you fill only
the To date. The error happens with both "Placed on" and "Received on".
When executing the query, the script checks that the To date is filled but it
doesn't check if the From date is also filled.
if ( (@linefilter) and ( $linefilter[1] ) ) {
$sth->execute( $linefilter[0], $linefilter[1] );
However, it checks both when building the SQL
if (@linefilter) {
if ( $linefilter[1] ) {
if ( $linefilter[0] ) {
$strsth .= " AND $line BETWEEN ? AND ? ";
} else {
$strsth .= " AND $line <= ? ";
}
} elsif (
( $linefilter[0] )
and ( ( $line =~ /closedate/ )
or ( $line =~ /received/ ) )
)
{
$strsth .= " AND $line >= ? ";
} elsif ( $linefilter[0] ) {
$linefilter[0] =~ s/\*/%/g;
$strsth .= " AND $line LIKE ? ";
}
}
This discrepancy is what creates the error, as it passes the SQL more variables
than it expects.
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/