TPac: Barcodes default to starting with digits
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 9 May 2012 13:08:13 +0000 (09:08 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 9 May 2012 13:51:39 +0000 (09:51 -0400)
Because otherwise there is likely to be a lot of confusion when barcodes no
longer work, at all, for login when groups have no barcode regex.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

index f41faf8..7791cf8 100644 (file)
@@ -349,6 +349,9 @@ sub load_login {
 
     my $bc_regex = $ctx->{get_org_setting}->($org_unit, 'opac.barcode_regex');
 
+    # To avoid surprises, default to "Barcodes start with digits"
+    $bc_regex = '^\d' unless $bc_regex;
+
     $args->{barcode} = delete $args->{username} 
         if $bc_regex and ($username =~ /$bc_regex/);