Bugzilla – Attachment 26459 Details for
Bug 11960
GetMemberDetails is unnecessarily called in CanBookBeRenewed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11960: GetMemberDetails is unnecessarily called in CanBookBeRenewed
Bug-11960-GetMemberDetails-is-unnecessarily-called.patch (text/plain), 1.46 KB, created by
Jonathan Druart
on 2014-03-19 16:01:22 UTC
(
hide
)
Description:
Bug 11960: GetMemberDetails is unnecessarily called in CanBookBeRenewed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-19 16:01:22 UTC
Size:
1.46 KB
patch
obsolete
>From 1babfca97773fcecd3d69cbce50733e80dc35be2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 19 Mar 2014 16:38:20 +0100 >Subject: [PATCH] Bug 11960: GetMemberDetails is unnecessarily called in > CanBookBeRenewed > >C4::Circulation::CanBookBeRenewed calls C4::Members::GetMemberDetails to >retrieve categorycode and branchcode. > >- categorycode is used to retrieve the issuing rule >- the borrower information is passed to > C4::Circulation::_GetCircControlBranch. Which only uses the branchcode > parameter. > >GetMemberDetails does a lot of useless calls/queries (patronflags, >account, etc.). > >This call could be replaced with a call to C4::Members::GetMember. > >Note: I presented this small optimisation during a quick introduction to >NYTProf (hackfest 14 in Marseille). > >Test plan: >- launch member unit tests >- check the code >--- > C4/Circulation.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index f8b204a..ae981a1 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2479,7 +2479,7 @@ sub CanBookBeRenewed { > my $itemissue = GetItemIssue($itemnumber) or return ( 0, 'no_checkout' ); > > $borrowernumber ||= $itemissue->{borrowernumber}; >- my $borrower = C4::Members::GetMemberDetails($borrowernumber) >+ my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) > or return; > > my $branchcode = _GetCircControlBranch($item, $borrower); >-- >1.7.10.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 11960
:
26456
|
26459
|
26479
|
27026