From cf2b4fb708d8af90d61134efb99dc31b94fbc35a Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 4 Mar 2014 10:06:47 +1300 Subject: [PATCH] Proper response header for a missing user when doing a LookUpUser --- lib/NCIP/Handler/LookupUser.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/NCIP/Handler/LookupUser.pm b/lib/NCIP/Handler/LookupUser.pm index 24f44cd..e116663 100644 --- a/lib/NCIP/Handler/LookupUser.pm +++ b/lib/NCIP/Handler/LookupUser.pm @@ -55,19 +55,21 @@ sub handle { } $user_id = $barcode; } + else { + $user_id = $user_id->textContent(); + } # We may get a password, username combo instead of userid # Need to deal with that also - my $user = NCIP::User->new( - { userid => $user_id->textContent(), ils => $self->ils } ); + my $user = NCIP::User->new( { userid => $user_id, ils => $self->ils } ); $user->initialise(); # if we have blank user, we need to return that # and can skip looking for elementtypes if ( $user->userdata->{'borrowernumber'} eq '' ) { my $vars; - $vars->{'messagetype'} = 'LookupUser'; + $vars->{'messagetype'} = 'LookupUserResponse'; $vars->{'error_detail'} = "Borrower not found"; my $output = $self->render_output( 'problem.tt', $vars ); return $output; -- 2.11.0