Bug 8039: Try userid if cardnumber borrower search fails in SIP

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Srdjan 2012-05-30 13:38:35 +12:00 committed by Jared Camins-Esakov
parent bc36e5ac5c
commit 861a191cd9
1 changed files with 2 additions and 2 deletions

View File

@ -31,13 +31,13 @@ sub new {
my ($class, $patron_id) = @_;
my $type = ref($class) || $class;
my $self;
$kp = GetMember(cardnumber=>$patron_id);
$kp = GetMember(cardnumber=>$patron_id) || GetMember(userid=>$patron_id);
$debug and warn "new Patron (GetMember): " . Dumper($kp);
unless (defined $kp) {
syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
return;
}
$kp = GetMemberDetails(undef,$patron_id);
$kp = GetMemberDetails($kp->{borrowernumber});
$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp);
my $pw = $kp->{password}; ### FIXME - md5hash -- deal with .
my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'";