From cfb0e9bf98f7a1080aa2b83cb2fcf59251e066e3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 21 Dec 2020 16:06:35 +0000 Subject: [PATCH] Bug 27148: (QA follow-up) Calculate default_strong_password correctly Fix a typo lenght for length If category strong password is not set, then we fall back to the preference, but that can be "" - which should be treated as 0 Signed-off-by: Jonathan Druart (cherry picked from commit 3b56076405bd0d171b702a63564339d80fa99359) Signed-off-by: Fridolin Somers --- .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index e7212c4225..d9ee294706 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -1235,12 +1235,12 @@ var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers"); var PWD_WEAK_MSG = _("Password must contain at least %s characters"); var default_password_length = [% defaultCategory.effective_min_password_length | html %]; - var default_strong_password = [% defaultCategory.effective_require_strong_password | html %]; + var default_strong_password = [% defaultCategory.effective_require_strong_password ? defaultCategory.effective_require_strong_password : 0 | html %]; $(document).ready(function() { var setPwdMessage = function() { var require_strong = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdStrong') : default_strong_password; - var min_lenght = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length; - $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_lenght)); + var min_length = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length; + $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_length)); }; setPwdMessage(); $('select#borrower_categorycode').change(setPwdMessage); -- 2.39.5