Bugzilla – Attachment 87295 Details for
Bug 21890
Allow forgotten password functionality to be limited by patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21890: (QA follow-up) Use List::Util::any
Bug-21890-QA-follow-up-Use-ListUtilany.patch (text/plain), 1.98 KB, created by
Martin Renvoize (ashimema)
on 2019-04-01 17:53:43 UTC
(
hide
)
Description:
Bug 21890: (QA follow-up) Use List::Util::any
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-01 17:53:43 UTC
Size:
1.98 KB
patch
obsolete
>From 2b81ab0c047a42093592e9cdcaec5ed6c70b1789 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 1 Apr 2019 18:46:21 +0100 >Subject: [PATCH] Bug 21890: (QA follow-up) Use List::Util::any > >When possible it's a good idea to use `any` from List::Util to shortcut >on the first occurence of a truthy value. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Template/Plugin/Categories.pm | 3 ++- > opac/opac-password-recovery.pl | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/Template/Plugin/Categories.pm b/Koha/Template/Plugin/Categories.pm >index f12c660faf..140f12a395 100644 >--- a/Koha/Template/Plugin/Categories.pm >+++ b/Koha/Template/Plugin/Categories.pm >@@ -20,6 +20,7 @@ use Modern::Perl; > use Template::Plugin; > use base qw( Template::Plugin ); > >+use List::Util qw(any); > use Koha::Patron::Categories; > > sub all { >@@ -34,7 +35,7 @@ sub GetName { > } > > sub can_any_reset_password { >- return ( grep { $_->effective_reset_password } @{ Koha::Patron::Categories->search->as_list } ) >+ return ( any { $_->effective_reset_password } @{ Koha::Patron::Categories->search->as_list } ) > ? 1 > : 0; > } >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index 8563e2551e..5cc6bd36f3 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -14,6 +14,7 @@ use Koha::Patrons; > my $query = new CGI; > use HTML::Entities; > use Try::Tiny; >+use List::Util qw/any/; > > my ( $template, $dummy, $cookie ) = get_template_and_user( > { >@@ -84,7 +85,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > $firstNonEmptyEmail = $emails[0] if @emails; > > # Is the given email one of the borrower's ? >- if ( $email && !( grep /^$email$/i, @emails ) ) { >+ if ( $email && !( any { /^$email$/i } @emails ) ) { > $hasError = 1; > $errNoBorrowerFound = 1; > } >-- >2.20.1
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 21890
:
84595
|
84596
|
84597
|
84598
|
84631
|
84632
|
84633
|
84634
|
85001
|
85002
|
85003
|
85004
|
85005
|
85006
|
86843
|
86844
|
86845
|
86846
|
86847
|
86866
|
86867
|
86868
|
86869
|
86870
|
86911
|
87289
|
87290
|
87291
|
87292
|
87293
|
87294
| 87295