From 427d8f9297fcc425a8a005418ba584d91e6d76ce Mon Sep 17 00:00:00 2001 From: Srdjan Date: Wed, 30 May 2012 13:38:35 +1200 Subject: [PATCH] bug_8039: Try userid if cardnumber borrower search fails in SIP Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- C4/SIP/ILS/Patron.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm index 69389eb..eae2383 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -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'"; -- 1.7.9.5