backporting barcode exists returns user id: svn merge -r7677:7678 svn://svn.open...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Aug 2007 17:47:04 +0000 (17:47 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Aug 2007 17:47:04 +0000 (17:47 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7679 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm

index 295126b..e065c6f 100644 (file)
@@ -2699,9 +2699,10 @@ sub barcode_exists {
        my( $self, $conn, $auth, $barcode ) = @_;
        my $e = new_editor(authtoken=>$auth);
        return $e->event unless $e->checkauth;
-       my $a = $e->search_actor_card({barcode => $barcode}, {idlist=>1});
-       return $$a[0] if $a and @$a;
-       return 0;
+       my $card = $e->search_actor_card({barcode => $barcode});
+    return 0 unless @$card;
+    my $user = $e->retrieve_actor_user($card->[0]->usr) or return $e->event;
+    return $user->id;
 }