@@ -, +, @@ --- Koha/Template/Plugin/Categories.pm | 3 ++- opac/opac-password-recovery.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/Koha/Template/Plugin/Categories.pm +++ a/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; } --- a/opac/opac-password-recovery.pl +++ a/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; } --