Bug 22891 - ILS-DI: RenewLoan explodes in error
Summary: ILS-DI: RenewLoan explodes in error
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords: regression
Depends on: 21206
Blocks: 22742
  Show dependency treegraph
 
Reported: 2019-05-11 09:56 UTC by Katrin Fischer
Modified: 2019-06-04 09:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Bug 22891: Add tests (2.18 KB, patch)
2019-05-12 16:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI) (1.31 KB, patch)
2019-05-12 16:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 22891: Add tests (2.28 KB, patch)
2019-05-13 09:29 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI) (1.41 KB, patch)
2019-05-13 09:29 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2019-05-11 09:56:44 UTC
I am getting an error message when trying to test RenewLoan from ILS-DI:


circular data structures not supported at /home/vagrant/kohaclone/opac/ilsdi.pl line 233.

or: 

Can't encode a value of type: CODE at /home/vagrant/kohaclone/opac/ilsdi.pl line 233.

URL I used:
http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=RenewLoan&patron_id=51&item_id=756

Itemnumber = 756 is checked out to my patron with the borrowernumber 51
Comment 1 Jonathan Druart 2019-05-12 16:29:11 UTC
Caused by
  commit 31c29fd31f557306233e6a2936148a5bb10b89a1
  Bug 21206: Replace C4::Items::GetItem
Comment 2 Jonathan Druart 2019-05-12 16:54:25 UTC
Created attachment 89640 [details] [review]
Bug 22891: Add tests
Comment 3 Jonathan Druart 2019-05-12 16:54:29 UTC
Created attachment 89641 [details] [review]
Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI)

From
  commit 31c29fd31f557306233e6a2936148a5bb10b89a1
  Bug 21206: Replace C4::Items::GetItem

A missing 'unless' test made RenewHold return prematurely:
  return $issue;
should have been
  return unless $issue;

Test plan:
Hit /cgi-bin/koha/ilsdi.pl?service=RenewLoan&patron_id=51&item_id=756

With different situations:
1. Item is checked out to the patron
2. Item is not checked out to the patron
3. Item does not exist
4. Patron does not exist
Comment 4 Marcel de Rooy 2019-05-13 09:29:40 UTC
Created attachment 89650 [details] [review]
Bug 22891: Add tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2019-05-13 09:29:43 UTC
Created attachment 89651 [details] [review]
Bug 22891: (bug 21206 follow-up) Fix RenewHold (ILS-DI)

From
  commit 31c29fd31f557306233e6a2936148a5bb10b89a1
  Bug 21206: Replace C4::Items::GetItem

A missing 'unless' test made RenewHold return prematurely:
  return $issue;
should have been
  return unless $issue;

Test plan:
Hit /cgi-bin/koha/ilsdi.pl?service=RenewLoan&patron_id=51&item_id=756

With different situations:
1. Item is checked out to the patron
2. Item is not checked out to the patron
3. Item does not exist
4. Patron does not exist

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2019-05-13 09:33:24 UTC
Combining SO and QA
Comment 7 Nick Clemens 2019-05-15 12:18:35 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-05-30 06:59:12 UTC
Bug caused by enhancement not in 18.11.x series.