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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 26 Dec 2020 16:58:33 +0000 (17:58 +0100)
commitf5373b7a5ea125f5b3123ab038a727d13315390f
tree5cbc2cbccdd17a875ce1e371c6a043fd47831cbf
parent6982680ae9e71d5d038e894842125860fcc986d6
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>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
opac/opac-memberentry.pl