Bugzilla – Attachment 69593 Details for
Bug 19766
Preview routing slip is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19766: (bug 19058 follow-up) Fix Preview routing slip
Bug-19766-bug-19058-follow-up-Fix-Preview-routing-.patch (text/plain), 2.79 KB, created by
Josef Moravec
on 2017-12-07 07:17:19 UTC
(
hide
)
Description:
Bug 19766: (bug 19058 follow-up) Fix Preview routing slip
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-12-07 07:17:19 UTC
Size:
2.79 KB
patch
obsolete
>From 19cef4589c8cdd6028c4c8937b1781d7922aff23 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Dec 2017 16:33:56 -0300 >Subject: [PATCH] Bug 19766: (bug 19058 follow-up) Fix Preview routing slip > >This patch fixes the following errors: >The method reserve_id is not covered by tests at /home/vagrant/kohaclone/C4/Reserves.pm line 859. >The method set is not covered by tests at /home/vagrant/kohaclone/C4/Reserves.pm line 871. >Can't call method "store" on an undefined value at /home/vagrant/kohaclone/C4/Reserves.pm line 871. > >This is caused by > commit ba1f2f93ef58c8dd935add3e215facdd4a589d12 > Bug 19058: Move C4::Reserves::GetReserveId to the Koha namespace > >We are calling ->reserve_id on a Koha::Holds set. > >Test plan: >- Serials -> Find subscription -> "Edit routing list" in the sidebar >- Add 1+ recipients >- Save -> "Save and preview routing slip" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Reserves.pm | 5 +++-- > t/db_dependent/Holds.t | 11 ++++++++++- > 2 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 71bbfba..4d8eb49 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -890,8 +890,9 @@ sub ModReserve { > > my $hold; > unless ( $reserve_id ) { >- $hold = Koha::Holds->search({ biblionumber => $biblionumber, borrowernumber => $borrowernumber, itemnumber => $itemnumber }); >- return unless $hold; # FIXME Should raise an exception >+ my $holds = Koha::Holds->search({ biblionumber => $biblionumber, borrowernumber => $borrowernumber, itemnumber => $itemnumber }); >+ return unless $holds->count; # FIXME Should raise an exception >+ $hold = $holds->next; > $reserve_id = $hold->reserve_id; > } > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 4ec4780..1e6c234 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -7,7 +7,7 @@ use t::lib::TestBuilder; > > use C4::Context; > >-use Test::More tests => 54; >+use Test::More tests => 55; > use MARC::Record; > use C4::Biblio; > use C4::Items; >@@ -147,6 +147,15 @@ ok( $hold->priority eq '4', "Test ModReserve, priority changed correctly" ); > ok( $hold->suspend, "Test ModReserve, suspend hold" ); > is( $hold->suspend_until, '2013-01-01 00:00:00', "Test ModReserve, suspend until date" ); > >+ModReserve({ # call without reserve_id >+ rank => '3', >+ biblionumber => $item_bibnum, >+ itemnumber => $itemnumber, >+ borrowernumber => $borrowernumber, >+}); >+$hold = Koha::Holds->find( $reserve_id ); >+ok( $hold->priority eq '3', "Test ModReserve, priority changed correctly" ); >+ > ToggleSuspend( $reserve_id ); > $hold = Koha::Holds->find( $reserve_id ); > ok( ! $hold->suspend, "Test ToggleSuspend(), no date" ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19766
:
69591
|
69592
| 69593