To reproduce: 1. check out an item 2. Go to circulation -> transfer and put in the barcode of the item you just checked out 3. error: Can't call method "borrowernumber" on unblessed reference at /home/vagrant/kohaclone/C4/Circulation.pm line 350 This occurs in the C4::Circulation::transferbook subroutine. It happens because Bug 18276 accidentally reintroduces an old subroutine (GetOpenIssue) that returns an unblessed reference. This line should use Koha Objects instead. Code causing an error: my $issue = GetOpenIssue($itemnumber); # check if it is still issued to someone, return it... if ( $issue ) { AddReturn( $barcode, $fbr ); $messages->{'WasReturned'} = $issue->borrowernumber; } Suggested fix: my $issue = Koha::Checkouts->find({ itemnumber => $itemnumber });
Upping severity.
Created attachment 95608 [details] [review] Bug 24013: Add tests
Created attachment 95609 [details] [review] Bug 24013: Fix transferbook if item is checked out Wrong conflict resolution, the following commit 6eade474ed3a84a5ba372a26ac27bf9fb4bd2299 Bug 18276: Remove GetBiblioFromItemNumber - Easy ones restored a previous change from commit 546379cc92b733cb29a0b70247a72c770afdad26 Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls Not that "easy" or "simple"... Test plan: Run the test before and after this patch.
Hello Aleisha, I removed the Academy kw and provided 2 patches, a bugfix and the tests to cover the changes. If you need this bug report to use as example, I can obsolete the bugfix and keep the tests. It sounded quite urgent to fix as it impact stable releases. Cheers
Created attachment 95695 [details] [review] Bug 24013: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 95696 [details] [review] Bug 24013: Fix transferbook if item is checked out Wrong conflict resolution, the following commit 6eade474ed3a84a5ba372a26ac27bf9fb4bd2299 Bug 18276: Remove GetBiblioFromItemNumber - Easy ones restored a previous change from commit 546379cc92b733cb29a0b70247a72c770afdad26 Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls Not that "easy" or "simple"... Test plan: Run the test before and after this patch. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks for the quick fix, works well.. Signing off.
Created attachment 95755 [details] [review] Bug 24013: Add tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 95756 [details] [review] Bug 24013: Fix transferbook if item is checked out Wrong conflict resolution, the following commit 6eade474ed3a84a5ba372a26ac27bf9fb4bd2299 Bug 18276: Remove GetBiblioFromItemNumber - Easy ones restored a previous change from commit 546379cc92b733cb29a0b70247a72c770afdad26 Bug 17680: C4::Circulation - Remove GetItemIssue, simple calls Not that "easy" or "simple"... Test plan: Run the test before and after this patch. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work! Pushed to master for 19.11.00
(In reply to Jonathan Druart from comment #4) > Hello Aleisha, > > I removed the Academy kw and provided 2 patches, a bugfix and the tests to > cover the changes. If you need this bug report to use as example, I can > obsolete the bugfix and keep the tests. > > It sounded quite urgent to fix as it impact stable releases. > > Cheers No worries Jonathan, thank you for fixing!
This affects 19.05 too and applies cleanly, can you push it Lucas?
backported to 19.05.x for 19.05.11