From f1e0d8845dadabd42fb01ad063c38d3d9455fc27 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 9 May 2012 09:08:13 -0400 Subject: [PATCH] TPac: Barcodes default to starting with digits 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 Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index f41faf838f..7791cf8021 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -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/); -- 2.11.0