From: Bill Erickson Date: Mon, 11 Sep 2017 18:25:13 +0000 (-0400) Subject: Teacher cards short username handles characters X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=da5d6a46f4ca05547ce31f26e4e00b5401e4a9a3;p=working%2FEvergreen.git Teacher cards short username handles characters Fixes bug in teacher account generator so that it properly handles student_id values less than 4 characters for both numbers and letters. Previously it would fail padding non-numeric IDs. Signed-off-by: Bill Erickson --- diff --git a/KCLS/utility-scripts/import_students/generate-patrons-from-csv.pl b/KCLS/utility-scripts/import_students/generate-patrons-from-csv.pl index df672e8813..f36903c41b 100755 --- a/KCLS/utility-scripts/import_students/generate-patrons-from-csv.pl +++ b/KCLS/utility-scripts/import_students/generate-patrons-from-csv.pl @@ -271,7 +271,7 @@ sub iterate_csv_rows { # If the ID value is less than 4 characters, pad the value # with zeros to be 4 characters long. This will effect # the barcode and password. Only do this for teacher accounts. - $phash->{student_id} = sprintf('%0.4d', $phash->{student_id}) + $phash->{student_id} = sprintf('%04s', $phash->{student_id}) if $is_teacher && length($phash->{student_id}) < 4; # All teacher ID's, which can be alpha-numeric, are upper case.