Bug 13990: (follow-up) silence warnings on testing
prove t/db_dependent/ILSDI_Services.t Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
a66fdeaa63
commit
5bdeeda457
|
|
@ -310,20 +310,21 @@ Parameters:
|
|||
sub LookupPatron {
|
||||
my ($cgi) = @_;
|
||||
|
||||
my $id = $cgi->param('id');
|
||||
if(!$id) {
|
||||
return { message => 'PatronNotFound' };
|
||||
}
|
||||
|
||||
my $patrons;
|
||||
|
||||
if(!$cgi->param('id')) {
|
||||
return { message => 'PatronNotFound' };
|
||||
}
|
||||
|
||||
if($cgi->param('id_type')) {
|
||||
$patrons = Koha::Patrons->search( { $cgi->param('id_type') => $cgi->param('id') } );
|
||||
my $passed_id_type = $cgi->param('id_type');
|
||||
if($passed_id_type) {
|
||||
$patrons = Koha::Patrons->search( { $passed_id_type => $id } );
|
||||
} else {
|
||||
foreach my $id_type ('cardnumber', 'userid', 'email', 'borrowernumber',
|
||||
foreach my $id_type ('cardnumber', 'userid', 'email', 'borrowernumber',
|
||||
'surname', 'firstname') {
|
||||
$patrons = Koha::Patrons->search( { $id_type => $cgi->param('id') } );
|
||||
last if($patrons->count);
|
||||
}
|
||||
$patrons = Koha::Patrons->search( { $id_type => $id } );
|
||||
last if($patrons->count);
|
||||
}
|
||||
}
|
||||
unless ( $patrons->count ) {
|
||||
return { message => 'PatronNotFound' };
|
||||
|
|
|
|||
Loading…
Reference in New Issue