From: Bill Erickson Date: Thu, 3 May 2012 20:36:38 +0000 (-0400) Subject: TPAC: Prevent unitialized variable warnings in My Account (repair) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6221c8988575adaf7960c2af8036c1ab986a97e9;p=evergreen%2Ftadl.git TPAC: Prevent unitialized variable warnings in My Account (repair) The logic in the second IF test was slightly altered by the fix. An undef value for username_unlimit should result in executing the block. Since org setting values are stored as real boolean values, I simplified the test to a simple if(!username_unlimit) test. Signed-off-by: Bill Erickson Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 830aae4a1b..979653c316 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -113,7 +113,7 @@ sub load_myopac_prefs { $self->ctx->{username_change_disallowed} = 1; } else { my $username_unlimit = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'opac.unlimit_usernames'); - if(defined($username_unlimit) and $username_unlimit != 1) { + if(!$username_unlimit) { my $regex_check = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'opac.barcode_regex'); if(!$regex_check) { # Default is "starts with a number" @@ -1489,7 +1489,7 @@ sub load_myopac_update_username { # We want this further down. $regex_check = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'opac.barcode_regex'); my $username_unlimit = $self->ctx->{get_org_setting}->($e->requestor->home_ou, 'opac.unlimit_usernames'); - if(defined($username_unlimit) and $username_unlimit != 1) { + if(!$username_unlimit) { if(!$regex_check) { # Default is "starts with a number" $regex_check = '^\d+';