If you create a patron with an empty opac login and an empty first name, save and then edit him/her, script will add a dot before login on OPAC Login box, for example if your surname is 'mongo' box gets pre-filled with '.mongo'. This is because script joins 'first name'.'surname' and with an empty first name, hence the initial dot. It would be desirable to have 'surname' as login (without dot) when there's no first name entered.
In Members.pm: sub Generate_Userid { my ($borrowernumber, $firstname, $surname) = @_; my $newuid; my $offset = 0; do { $firstname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; $surname =~ s/[[:digit:][:space:][:blank:][:punct:][:cntrl:]]//g; $newuid = lc("$firstname.$surname"); $newuid .= $offset unless $offset == 0; $offset++; } while (!Check_Userid($newuid,$borrowernumber)); return $newuid; }
Created attachment 3960 [details] [review] fix Member.pm Now it chooses surname if firstname is blank, no dots added. It behaves the same if both are provided.
This patch can be verified by reading the code. Marking as Passed QA.
Merged to master please test