Bug 21020 - Return branch not set for transfer when using SIP
Summary: Return branch not set for transfer when using SIP
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 17680
Blocks: 27166
  Show dependency treegraph
 
Reported: 2018-06-29 12:58 UTC by Nick Clemens
Modified: 2020-12-10 19:00 UTC (History)
6 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 21020: Fix return branch on transfer - SIP (1.65 KB, patch)
2018-06-29 13:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21020: Fix return branch on transfer - SIP (1.65 KB, patch)
2018-06-29 14:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21020: Fix return branch on transfer - SIP (2.23 KB, patch)
2018-06-29 14:29 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21020: Fix return branch on transfer - SIP (2.33 KB, patch)
2018-07-06 07:27 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 Nick Clemens 2018-06-29 12:58:30 UTC
Bug 17680 replace GetItemIssue with a call to the Issue object - the code in /C4/SIP/ILS/Transaction/Checkin.pm expects item information

I think line 97:
        $self->{item}->destination_loc($iteminformation->{homebranch});
Should be:
        $self->{item}->destination_loc($iteminformation->item->homebranch);
Comment 1 Jonathan Druart 2018-06-29 13:08:40 UTC
Created attachment 76563 [details] [review]
Bug 21020: Fix return branch on transfer - SIP

Caused by
  commit 546379cc92b733cb29a0b70247a72c770afdad26
  Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls

Since this commit AddReturn return a Koha::Issue object, not a hashref
with item's info.

Test plan:
?
Comment 2 Kyle M Hall 2018-06-29 13:31:29 UTC
Jonathan, shouldn't "$issue->issue->homebranch" be "$issue->item->homebranch"?
Comment 3 Jonathan Druart 2018-06-29 14:09:43 UTC
Created attachment 76570 [details] [review]
Bug 21020: Fix return branch on transfer - SIP

Caused by
  commit 546379cc92b733cb29a0b70247a72c770afdad26
  Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls

Since this commit AddReturn return a Koha::Issue object, not a hashref
with item's info.

Test plan:
?
Comment 4 Jonathan Druart 2018-06-29 14:10:11 UTC
(In reply to Kyle M Hall from comment #2)
> Jonathan, shouldn't "$issue->issue->homebranch" be
> "$issue->item->homebranch"?

Whoops, yes of course! Thanks for catching that :)
Comment 5 Nick Clemens 2018-06-29 14:29:44 UTC
Created attachment 76574 [details] [review]
Bug 21020: Fix return branch on transfer - SIP

Caused by
  commit 546379cc92b733cb29a0b70247a72c770afdad26
  Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls

Since this commit AddReturn return a Koha::Issue object, not a hashref
with item's info.

Test plan:
1 - Enable SIP server on your test instance
   For kohadevbox:
   cp /etc/koha/SIPConfig.xml /etc/koha/sites/kohadev/
   create patron with user/pass term1/term1 and grant circulation
   privileges
2 - enable AutomaticItemReturn
3 - Checkin an item which will generate a transfer via SIP2:
   perl /home/vagrant/kohaclone/misc/sip_cli_emulator.pl -a localhost -p
   6001 -su term1 -sp term1 -l LPL --item {BARCODE} -m checkin -t
   CR
4 - Note no CT field
5 - Apply patch
6 - Repeate checkin via SIP2
7 - Transfer destination is correctly returned in CT

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Marcel de Rooy 2018-07-06 07:27:34 UTC
Created attachment 76716 [details] [review]
Bug 21020: Fix return branch on transfer - SIP

Caused by
  commit 546379cc92b733cb29a0b70247a72c770afdad26
  Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls

Since this commit AddReturn return a Koha::Issue object, not a hashref
with item's info.

Test plan:
1 - Enable SIP server on your test instance
   For kohadevbox:
   cp /etc/koha/SIPConfig.xml /etc/koha/sites/kohadev/
   create patron with user/pass term1/term1 and grant circulation
   privileges
2 - enable AutomaticItemReturn
3 - Checkin an item which will generate a transfer via SIP2:
   perl /home/vagrant/kohaclone/misc/sip_cli_emulator.pl -a localhost -p
   6001 -su term1 -sp term1 -l LPL --item {BARCODE} -m checkin -t
   CR
4 - Note no CT field
5 - Apply patch
6 - Repeate checkin via SIP2
7 - Transfer destination is correctly returned in CT

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Nick Clemens 2018-07-06 14:41:56 UTC
Awesome work all!

Pushed to master for 18.11
Comment 8 Martin Renvoize 2018-07-10 06:35:22 UTC
Pushed to 18.05.x for 18.05.02
Comment 9 Fridolin Somers 2018-07-12 06:38:05 UTC
Pushed to 17.11.x for 17.11.08
Comment 10 Fridolin Somers 2018-09-24 13:23:44 UTC
Depends on Bug 17680 not in 17.05.x