From: Jason Stephenson Date: Thu, 11 Dec 2014 00:14:13 +0000 (-0500) Subject: Return only 1 barcode for UserId in NCIP::ILS::Evergreen->lookupuser. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=436afc28cddd07cab93859e3c0bbac266a1da1c0;p=NCIPServer.git Return only 1 barcode for UserId in NCIP::ILS::Evergreen->lookupuser. Signed-off-by: Jason Stephenson --- diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 02e5682..0d89fe8 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -163,18 +163,12 @@ sub lookupuser { # We got the information, so lets fill in our userdata. my $userdata = NCIP::User->new(); - # Make an array of the user's active barcodes. - my $ids = []; - foreach my $card (@{$user->cards()}) { - if ($U->is_true($card->active())) { - my $id = NCIP::User::Id->new({ - UserIdentifierType => 'Barcode', - UserIdentifierValue => $card->barcode() - }); - push(@$ids, $id); - } - } - $userdata->UserId($ids); + # Use the user's main card as the UserId. + my $id = NCIP::User::Id->new({ + UserIdentifierType => 'Barcode', + UserIdnetifierValue => $user->card->barcode() + }); + $userdata->UserId($id); # Check if they requested any optional fields and return those. my $elements = $request->{$message_type}->{UserElementType};