Bug 8843 - Cannot export bibliographic records by call number
Summary: Cannot export bibliographic records by call number
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 14:47 UTC by Owen Leonard
Modified: 2013-05-23 06:23 UTC (History)
4 users (show)

See Also:
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 (1.41 KB, patch)
2012-09-28 14:52 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8843 - Cannot export bibliographic records by call number (1.47 KB, patch)
2012-09-28 16:40 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Bug 8843 [3.8.x] Cannot export bibliographic records by call number (1.33 KB, patch)
2012-11-21 20:11 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 8843 [3.8.x] Cannot export bibliographic records by call number (1.35 KB, patch)
2012-11-23 13:13 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.