Summary: | Mis-scoped function call in C4::Auth | ||
---|---|---|---|
Product: | Koha | Reporter: | Jared Camins-Esakov <jcamins> |
Component: | Architecture, internals, and plumbing | Assignee: | Jared Camins-Esakov <jcamins> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, jonathan.druart, paul.poulain, veron |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 8311: Fix scoping error in C4::Auth
[SIGNED-OFF] Bug 8311: Fix scoping error in C4::Auth |
Description
Jared Camins-Esakov
2012-06-25 16:06:23 UTC
Created attachment 10481 [details] [review] Bug 8311: Fix scoping error in C4::Auth There is a mis-scoped function call in C4::Auth, on line 154, where GetMembers is called without explicit scoping and before 'require C4::Members;'. This does not actually have any functional ramifications as far as I can tell, but it would be a good idea to fix it. This patch also corrects a bit of indenting in that area, because it was an unnecessary challenge to understand the code with the mis-indenting. Created attachment 10532 [details] [review] [SIGNED-OFF] Bug 8311: Fix scoping error in C4::Auth There is a mis-scoped function call in C4::Auth, on line 154, where GetMembers is called without explicit scoping and before 'require C4::Members;'. This does not actually have any functional ramifications as far as I can tell, but it would be a good idea to fix it. This patch also corrects a bit of indenting in that area, because it was an unnecessary challenge to understand the code with the mis-indenting. Signed-off-by: Marc Veron <veron@veron.ch> I don't know how we can reproduce the error. But the patch fixes a mis-scoped function. Marking as Passed QA QA comment: Why did you put the line require C4::Members; outside from if (!defined($borrowernumber) && defined($user)) { ? The way you made it, C4::Members will be loaded on everypage, that will impact performances ! Written: if (!defined($borrowernumber) && defined($user)) { require C4::Members; my $borrower = C4::Members::GetMember(borrowernumber => $user); will load the C4::Members only if the getborrowernumber does not return the user (which should never happen) waiting for your feedback, not pushing not marking failed QA (In reply to comment #4) > QA comment: > > Why did you put the line > require C4::Members; > outside from > if (!defined($borrowernumber) && defined($user)) { > ? > > The way you made it, C4::Members will be loaded on everypage, that will > impact performances ! C4::Members was always loaded whenever $user was set. I just moved the require up so that it was before *both* calls to routines in C4::Members (if you scroll down about a page, you'll see a call to GetMemberDetails. > Written: > if (!defined($borrowernumber) && defined($user)) { > require C4::Members; > my $borrower = C4::Members::GetMember(borrowernumber => $user); > will load the C4::Members only if the getborrowernumber does not return the > user (which should never happen) > > waiting for your feedback, not pushing not marking failed QA OK, got it. Patch pushed Pushed to 3.8.x, will be in 3.8.3 |