Bugzilla – Attachment 64598 Details for
Bug 16711
OPAC Password recovery: Handling if multiple accounts have the same mail address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16711: (QA-followup) Use count directly
Bug-16711-QA-followup-Use-count-directly.patch (text/plain), 2.55 KB, created by
Marc Véron
on 2017-06-23 15:49:54 UTC
(
hide
)
Description:
Bug 16711: (QA-followup) Use count directly
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-06-23 15:49:54 UTC
Size:
2.55 KB
patch
obsolete
>From 5b1822810632b555c678f41ac6ce1f9004ef246e Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 23 Jun 2017 17:48:32 +0200 >Subject: [PATCH] Bug 16711: (QA-followup) Use count directly > >See comment # 13 >--- > opac/opac-password-recovery.pl | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index 0a35e78..f15a93e 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -36,7 +36,6 @@ my $borrower_number; > > #errors > my $hasError; >-my $resultCount; > > #email form error > my $errNoBorrowerFound; >@@ -56,31 +55,29 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > #try with the main email > $email ||= ''; # avoid undef > my $borrower; >- my $search_results = []; >+ my $search_results; > > # Find the borrower by his userid or email > if ($username) { >- $search_results = [ Koha::Patrons->search( { userid => $username } ) ]; >- $resultCount = Koha::Patrons->search( { userid => $username } ) -> count >+ $search_results = Koha::Patrons->search( { userid => $username } ); > } > elsif ($email) { >- $search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ]; >- $resultCount = Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) -> count; >+ $search_results = Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ); > } > >- if ( not $search_results || $resultCount < 1) { >+ if ( not $search_results || $search_results->count < 1) { > $hasError = 1; > $errNoBorrowerFound = 1; > } >- elsif ( $username && scalar $resultCount > 1) { # Multiple accounts for username >+ elsif ( $username && $search_results->count > 1) { # Multiple accounts for username > $hasError = 1; > $errNoBorrowerFound = 1; > } >- elsif ( $email && scalar $resultCount > 1) { # Muliple accounts for E-Mail >+ elsif ( $email && $search_results->count > 1) { # Muliple accounts for E-Mail > $hasError = 1; > $errMultipleAccountsForEmail = 1; > } >- elsif ( $borrower = shift @$search_results ) { # One matching borrower >+ elsif ( $borrower = $search_results->next() ) { # One matching borrower > $username ||= $borrower->userid; > my @emails = ( $borrower->email, $borrower->emailpro, $borrower->B_email ); > >-- >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 16711
:
63591
|
63600
|
64064
|
64598
|
64604
|
64605