From: Thomas Berezansky Date: Wed, 9 May 2012 13:08:13 +0000 (-0400) Subject: TPac: Barcodes default to starting with digits X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fe4262c7fbbc01f167b04a5916800a62b823c6cd;p=contrib%2FConifer.git 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 --- 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/);