Summary: | Aggregate SQL clauses break pagination in guided reports | ||
---|---|---|---|
Product: | Koha | Reporter: | Chris Cormack <chris> |
Component: | Reports | Assignee: | Galen Charlton <gmcharlt> |
Status: | CLOSED DUPLICATE | QA Contact: | Bugs List <koha-bugs> |
Severity: | major | ||
Priority: | P5 - low | CC: | jwagner |
Version: | Main | ||
Hardware: | PC | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: |
Description
Chris Cormack
2010-05-21 01:09:02 UTC
There is no pagination. There is no message showing that there are more results than showing on the screen. The csv export is not comfortable and missing the links to borrower accounts and other Koha pages used in the report. I think I found the place in the code, but I get lost trying to understand it: guided_reports.pl 487 my $total = select_2_select_count_value($sql) || 0; Guided.pm 402 sub select_2_select_count_value ($) { 403 my $sql = shift or return; 404 my $countsql = select_2_select_count($sql); 405 $debug and warn "original query: $sql\ncount query: $countsql\n"; 406 my $sth1 = C4::Context->dbh->prepare($countsql); 407 $sth1->execute(); 408 my $total = $sth1->fetchrow(); 409 $debug and warn "total records for this query: $total\n"; 410 return $total; 411 } 412 sub select_2_select_count ($) { 413 # Modify the query passed in to create a count query... (I think this covers all cases -crn) 414 my ($sql) = strip_limit(shift) or return; 415 $sql =~ s/\bSELECT\W+(?:\w+\W+){1,}?FROM\b|\bSELECT\W\*\WFROM\b/SELECT count(*) FROM /ig; 416 return $sql; 417 } Is there perhaps a better way to find out the number of results of a sql query? |