Bugzilla – Attachment 85166 Details for
Bug 21206
C4::Items - Remove GetItem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21206: (follow-up) Fix Circulation.t
Bug-21206-follow-up-Fix-Circulationt.patch (text/plain), 3.14 KB, created by
Jonathan Druart
on 2019-02-15 13:40:05 UTC
(
hide
)
Description:
Bug 21206: (follow-up) Fix Circulation.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-02-15 13:40:05 UTC
Size:
3.14 KB
patch
obsolete
>From 3eabf664f7ac7d898def33eec7d7b2c128396739 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 4 Dec 2018 11:40:17 +0000 >Subject: [PATCH] Bug 21206: (follow-up) Fix Circulation.t > >Test plan: >prove t/db_dependent/Circulation.t > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Circulation.pm | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 95deb4184b..f717cd7ca6 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1453,7 +1453,7 @@ sub AddIssue { > SendCirculationAlert( > { > type => 'CHECKOUT', >- item => $item, >+ item => $item->unblessed, > borrower => $borrower, > branch => $branch, > } >@@ -1823,14 +1823,14 @@ sub AddReturn { > my $itemnumber = $item->itemnumber; > my $itemtype = $item->effective_itemtype; > >- my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); >+ my $issue = $item->checkout; > if ( $issue ) { >- $patron = Koha::Patrons->find( $issue->borrowernumber ) >+ $patron = $issue->patron > or die "Data inconsistency: barcode $barcode (itemnumber:$itemnumber) claims to be issued to non-existent borrowernumber '" . $issue->borrowernumber . "'\n" > . Dumper($issue->unblessed) . "\n"; > } else { > $messages->{'NotIssued'} = $barcode; >- ModItem({ onloan => undef }, $item->{biblionumber}, $item->{itemnumber}) if defined $item->{onloan}; >+ ModItem({ onloan => undef }, $item->biblionumber, $item->itemnumber) if defined $item->onloan; > # even though item is not on loan, it may still be transferred; therefore, get current branch info > $doreturn = 0; > # No issue, no borrowernumber. ONLY if $doreturn, *might* you have a $borrower later. >@@ -2616,14 +2616,11 @@ sub CanBookBeRenewed { > my $renews = 1; > > my $item = Koha::Items->find($itemnumber) or return ( 0, 'no_item' ); >- my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return ( 0, 'no_checkout' ); >+ my $issue = $item->checkout or return ( 0, 'no_checkout' ); > return ( 0, 'onsite_checkout' ) if $issue->onsite_checkout; > return ( 0, 'item_denied_renewal') if _item_denied_renewal({ item => $item }); > >- >- $borrowernumber ||= $issue->borrowernumber; >- my $patron = Koha::Patrons->find( $borrowernumber ) >- or return; >+ my $patron = $issue->patron or return; > > my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); > >@@ -4144,7 +4141,7 @@ sub _item_denied_renewal { > my $denyingrules = Koha::Config::SysPrefs->find('ItemsDeniedRenewal')->get_yaml_pref_hash(); > return unless $denyingrules; > foreach my $field (keys %$denyingrules) { >- my $val = $item->{$field}; >+ my $val = $item->$field; > if( !defined $val) { > if ( any { !defined $_ } @{$denyingrules->{$field}} ){ > return 1; >-- >2.11.0
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 21206
:
77699
|
77700
|
77701
|
78080
|
78081
|
78082
|
78153
|
78154
|
78155
|
82831
|
82832
|
82833
|
82834
|
84006
|
84007
|
84008
|
84009
|
84010
|
84184
|
84185
|
84186
|
84187
|
84188
|
85163
|
85164
|
85165
| 85166 |
85167
|
85168