Bug 11783 - Record level unavailable holds sending empty CD field rather than item barcode
Summary: Record level unavailable holds sending empty CD field rather than item barcode
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on: 10817
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-18 14:47 UTC by Kyle M Hall
Modified: 2014-12-07 20:05 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11783 - Record level unavailable holds sending empty CD field rather than item barcode (1.45 KB, patch)
2014-02-18 14:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 11783 - Record level unavailable holds sending empty CD field rather than item barcode (1.50 KB, patch)
2014-02-18 22:07 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11783 - Record level unavailable holds sending empty CD field rather than item barcode (2.01 KB, patch)
2014-02-19 11:15 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 Kyle M Hall 2014-02-18 14:47:09 UTC
If a patron has a record-level hold that is unavailable, any patron information request will send back an empty CD field when this field should have an item barcode in it. This is due to a minor error in ILS::Patron::_get_outstanding_hodsl where GetItemnumbersForBiblio is assumed to return an array but in reality returns an arrayref.
Comment 1 Kyle M Hall 2014-02-18 14:49:58 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-02-18 22:07:14 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-02-19 11:15:54 UTC
Created attachment 25440 [details] [review]
Bug 11783 - Record level unavailable holds sending empty CD field rather than item barcode

If a patron has a record-level hold that is unavailable, any patron
information request will send back an empty CD field when this field
should have an item barcode in it. This is due to a minor error in
ILS::Patron::_get_outstanding_hodsl where GetItemnumbersForBiblio is
assumed to return an array but in reality returns an arrayref.

Test Plan:
1) Create a record level hold for a patron and record
2) Using SIP2, make a patron information request
3) Note the empty CD fields
4) Apply this patch, restart SIP server
5) Repeat step 2
6) Note the CD field now has a barcode

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I did not test this patch but the following code shows me it is correct:
  use C4::Items;
  use Data::Dumper;
  my $biblionumber = 5035;
  my $itemnumber = (GetItemnumbersForBiblio($biblionumber))[0];
  say Dumper $itemnumber;
  $itemnumber = (GetItemnumbersForBiblio($biblionumber))->[0];
  say Dumper $itemnumber;

displays:

$VAR1 = [
          '23168',
          '23169',
          '23170',
          '23171',
          '23172'
        ];

$VAR1 = '23168';
Comment 4 Galen Charlton 2014-02-19 17:18:41 UTC
Pushed to master.  Thanks, Kyle!

I note that a warning will likely be logged if there are no items attached to the being being requested (as might happen if the items were deleted after the request was placed).  However, that would have happened prior to this patch as well.
Comment 5 Fridolin Somers 2014-05-19 15:10:31 UTC
Pushed to 3.14.x, will be in 3.14.07