Bugzilla – Attachment 65124 Details for
Bug 18572
Improper branchcode set during OPAC renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18572 - QA Followup
Bug-18572---QA-Followup.patch (text/plain), 3.29 KB, created by
Nick Clemens (kidclamp)
on 2017-07-19 18:33:17 UTC
(
hide
)
Description:
Bug 18572 - QA Followup
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-07-19 18:33:17 UTC
Size:
3.29 KB
patch
obsolete
>From 1231b97d67275b9626b64c17fae81d4484809474 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 19 Jul 2017 18:26:07 +0000 >Subject: [PATCH] Bug 18572 - QA Followup > >--- > C4/Circulation.pm | 3 +-- > opac/opac-renew.pl | 2 +- > t/db_dependent/Circulation/issue.t | 13 ++++++++++--- > 3 files changed, 12 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index eab128e..ead7e2b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2815,7 +2815,6 @@ sub AddRenewal { > my $branch = shift; > my $datedue = shift; > my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd(); >- my $opacrenewal = shift; > > my $item = GetItem($itemnumber) or return; > my $item_object = Koha::Items->find( $itemnumber ); # Should replace $item >@@ -2916,7 +2915,7 @@ sub AddRenewal { > DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); > } > >- unless ( $opacrenewal ) { #if from opac we are obeying OpacRenewalBranch as calculated in opac-renew.pl >+ unless ( C4::Context->interface eq 'opac' ) { #if from opac we are obeying OpacRenewalBranch as calculated in opac-renew.pl > $branch = C4::Context->userenv ? C4::Context->userenv->{branch} : $branch; > } > >diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl >index 580faab..676012e 100755 >--- a/opac/opac-renew.pl >+++ b/opac/opac-renew.pl >@@ -82,7 +82,7 @@ else { > else { > $branchcode = 'OPACRenew'; > } >- AddRenewal( $borrowernumber, $itemnumber, $branchcode, undef, undef, 1 ); >+ AddRenewal( $borrowernumber, $itemnumber, $branchcode, undef, undef ); > push( @renewed, $itemnumber ); > } > else { >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index e06882a..c78c82a 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -216,6 +216,9 @@ is ($countaccount,1,"1 accountline has been added"); > > # Test AddRenewal > >+my $se = Test::MockModule->new( 'C4::Context' ); >+$se->mock( 'interface', sub {return 'intranet'}); >+ > # Let's renew this one at a different library for statistical purposes to test Bug 17781 > C4::Context->set_userenv(@USERENV_DIFFERENT_LIBRARY); > my $datedue3 = AddRenewal( $borrower_id1, $item_id1, $branchcode_1, $datedue1, $daysago10 ); >@@ -230,14 +233,18 @@ like( > my $stat = $dbh->selectrow_hashref("SELECT * FROM statistics WHERE type = 'renew' AND borrowernumber = ? AND itemnumber = ? AND branch = ?", undef, $borrower_id1, $item_id1, $branchcode_3 ); > ok( $stat, "Bug 17781 - 'Improper branchcode set during renewal' still fixed" ); > >+$se->mock( 'interface', sub {return 'opac'}); >+ > #Let's do an opac renewal - whatever branchcode we send should be used >-my $opac_renew_issue = $builder->build({ source=>"Issue",value=>{ >+my $opac_renew_issue = $builder->build({ >+ source=>"Issue", >+ value=>{ > date_due => '2017-01-01', > branch => $branchcode_1, > itype => $itemtype, > borrowernumber => $borrower_id1 >- } >- }); >+ } >+}); > > my $datedue4 = AddRenewal( $opac_renew_issue->{borrowernumber}, $opac_renew_issue->{itemnumber}, "Stavromula", $datedue1, $daysago10, 1 ); > >-- >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 18572
:
64596
|
64609
|
64610
|
65048
|
65123
| 65124 |
65201