Bug 27148: Fix bug on self registration when user category is hidden
authorAgustin Moyano <agustinmoyano@theke.io>
Thu, 3 Dec 2020 16:10:18 +0000 (13:10 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 28 Dec 2020 14:55:46 +0000 (15:55 +0100)
commit6ea59523791edee0e9e0a3dc680935ed7e11a2d7
treee736fae23b16e4053b5ca7b3bb922aa52a1abbc2
parente906a737f2f77d79b125ac292172d93191b672f3
Bug 27148: Fix bug on self registration when user category is hidden

This patch fixes the bug when there is no patron category available for
selection in self registration form. It uses PatronSelfRegistrationDefaultCategory
to get patron's password length and strength.

To test:
1. Do not apply this patch
2. Allow SeflRegistration, set PatronSelfRegistrationDefaultCategory to
   a valid patron category and finally add categorycode to PatronSelfRegistrationBorrowerUnwantedField
3. Go to opac and enter self registration form
CHECK => There is no patron category available for selection
      => Password's info alert shows "Password must contain at least
undefined characters"
4. Fill the form setting a password and send.
CHECH => You get an exception saying "You must provide a patron's
category to validate password's strength and length"
5. Apply this patch and restart_all
6. repeat steps 3 and 4
SUCCESS => Password's info alert message shows a number instead of
"undefined"
        => Password's strength and length checks are working
        => If you change default category's lenght or strength parameter it get's reflected when you refresh the page
        => When you click send, patron is saved

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f5373b7a5ea125f5b3123ab038a727d13315390f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
opac/opac-memberentry.pl