Bug 8843

Summary: Cannot export bibliographic records by call number
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ToolsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: chris, elliott, nengard, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 8843 - Cannot export bibliographic records by call number
[SIGNED-OFF] Bug 8843 - Cannot export bibliographic records by call number
Bug 8843 [3.8.x] Cannot export bibliographic records by call number
Bug 8843 [3.8.x] Cannot export bibliographic records by call number

Description Owen Leonard 2012-09-28 14:47:48 UTC
The logic is wrong when building the query:

if ($start_callnumber) {
    $sql_query .= " AND itemcallnumber <= ? ";
    push @sql_params, $start_callnumber;
}

if ($end_callnumber) {
    $sql_query .= " AND itemcallnumber >= ? ";
    push @sql_params, $end_callnumber;
}

The query must include items with call numbers *greater than* the starting call number and *less than* the ending call number, not vice versa.
Comment 1 Owen Leonard 2012-09-28 14:52:40 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2012-09-28 16:40:38 UTC Comment hidden (obsolete)
Comment 3 Paul Poulain 2012-10-12 14:38:37 UTC
QA Comment
 * trivial bugfix !
 * tiny bugfix !
passes QA
Comment 4 Paul Poulain 2012-10-12 14:40:18 UTC
Patch pushed to master
Comment 5 Chris Cormack 2012-10-14 07:30:41 UTC
Doesn't apply to 3.8.x, please rebase and submit for 3.8.x if needed
Comment 6 Owen Leonard 2012-11-21 20:11:07 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2012-11-23 13:13:03 UTC
Created attachment 13646 [details] [review]
Bug 8843 [3.8.x] Cannot export bibliographic records by call number

Reworked for 3.8.x: When building the query for exports by call
number the script has the logic reversed. It tries to select
records with call numbers less than the starting call number and
greater than the ending call number. This should be reversed.

To test, test an export in an unpatched system. An export by
call number will return an empty file. After applying the patch
an export by call number should give valid results.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Elliott Davis 2012-12-07 20:18:12 UTC
Marking Passed QA so that it will be visible to the 3.8.x RMaint.
Comment 9 Chris Cormack 2012-12-13 19:31:22 UTC
Pushed to 3.8.x, will be in 3.8.8, thank you for your effort of rebasing it.