Bug 14867: userid not generated when defined in BorrowerUnwantedField
authorFridolin Somers <fridolin.somers@biblibre.com>
Tue, 22 Sep 2015 07:49:39 +0000 (09:49 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Nov 2015 15:09:01 +0000 (12:09 -0300)
commit0cbc65111c735e699d94d50ad09c17fb7b7b8913
tree060b30fd4f1d194e9ffe5d122e805d0b51f9440a
parente0032c46e98b4cf31d76abb93d12041ea362d81e
Bug 14867: userid not generated when defined in BorrowerUnwantedField

When userid is not provided when creating a new patron, it is generated
using surname and firstname.  The bug is when userid is defined in
syspref BorrowerUnwantedField, the input text is missing in patron
creation form. When saving you always get an alert message :
"Username/password already exists". No patron can be created.

This patch corrects by adding this case to userid generation conditions.

Test plan :
- add 'userid' in syspref BorrowerUnwantedField
- try to create a new patron : /cgi-bin/koha/members/memberentry.pl
- there is not input text for userid
- choose non-existing surname and firstname
- click on save
  => Without patch : patron is not created, you see the alert message
     "Username/password already exists"
  => With patch : patron is created, userid is generated with surname
     and firstname
- remove 'userid' in syspref BorrowerUnwantedField and check it can be
  defined in patron creation form

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  The issue is there, and this patch fixes it.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
members/memberentry.pl