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>
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/);