[open-ils-commits] r7678 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Aug 15 13:49:08 EDT 2007


Author: erickson
Date: 2007-08-15 13:45:07 -0400 (Wed, 15 Aug 2007)
New Revision: 7678

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
updated barcode exists method to return the user id instead of the card id

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2007-08-15 17:27:44 UTC (rev 7677)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2007-08-15 17:45:07 UTC (rev 7678)
@@ -2726,9 +2726,10 @@
 	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;
 }
 
 



More information about the open-ils-commits mailing list