Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6"
Created attachment 115154 [details] [review] Bug 27430 - Use password minimum length for patron category on password hint Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6" 5. Apply patch. 6. Hint should now read "Minimum password length: 4".
Created attachment 115157 [details] [review] Bug 27430: Use password minimum length for patron category on password hint Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6" 5. Apply patch. 6. Hint should now read "Minimum password length: 4". Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I would suggest we make this change in member-password.tt too.
(In reply to Owen Leonard from comment #3) > I would suggest we make this change in member-password.tt too. I've tried to see where this is needed it it looked ok to me - can you explaina bit more?
Created attachment 115226 [details] [review] Bug 27430: Use password minimum length for patron category on password hint Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6" 5. Apply patch. 6. Hint should now read "Minimum password length: 4". Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
While this improves the situation, there is still an issue: When the patron category is changed, the hint might be wrong. Do we need an ajax call here to adjust the hint to the patron category selected?
(In reply to Owen Leonard from comment #3) > I would suggest we make this change in member-password.tt too. I don't see where in member-password.tt this would be necessary. Did you mean some other page? (In reply to Katrin Fischer from comment #6) > While this improves the situation, there is still an issue: When the patron > category is changed, the hint might be wrong. Do we need an ajax call here > to adjust the hint to the patron category selected? Good point. This might be confusing for users especially when error message is adjusted by the selected patron category.
Created attachment 115233 [details] [review] Bug 27430: Change password minimum value hint when patron category is changed If patrons category is changed during add or edit password minimum value doesn't change. This patch adds ajax call to fix this. To test: 1. Add password minimum length for patron categories A and B. 2. Create a new patron with category A. 3. Change patrons category to B. 4. Note that password minimum value doesn't change on hint text. 5. Apply patch. 6. Repeat patron creation, password minimum value should now change correctly.
Created attachment 115316 [details] [review] Bug 27430: Use password minimum length for patron category on password hint Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6" 5. Apply patch. 6. Hint should now read "Minimum password length: 4". Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Created attachment 115317 [details] [review] Bug 27430: Change password minimum value hint when patron category is changed If patrons category is changed during add or edit password minimum value doesn't change. This patch adds ajax call to fix this. To test: 1. Add password minimum length for patron categories A and B. 2. Create a new patron with category A. 3. Change patrons category to B. 4. Note that password minimum value doesn't change on hint text. 5. Apply patch. 6. Repeat patron creation, password minimum value should now change correctly. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Works as described.
(In reply to Emmi Takkinen from comment #7) > > (In reply to Owen Leonard from comment #3) > > I would suggest we make this change in member-password.tt too. > > I don't see where in member-password.tt this would be necessary. Did you > mean some other page? Wouldn't we want to show the required password length on the page for changing the patron's username and password? /cgi-bin/koha/members/member-password.pl?member=XXX
(In reply to Owen Leonard from comment #12) > (In reply to Emmi Takkinen from comment #7) > > > > (In reply to Owen Leonard from comment #3) > > > I would suggest we make this change in member-password.tt too. > > > > I don't see where in member-password.tt this would be necessary. Did you > > mean some other page? > > Wouldn't we want to show the required password length on the page for > changing the patron's username and password? > > /cgi-bin/koha/members/member-password.pl?member=XXX Hm it did show for me in testing, but only after I had tried to save a too short one - mean to show the hint always?
Created attachment 116105 [details] [review] Bug 27430: Change password minimum value hint when patron category is changed If patrons category is changed during add or edit password minimum value doesn't change. This patch adds ajax call to fix this. To test: 1. Add password minimum length for patron categories A and B. 2. Create a new patron with category A. 3. Change patrons category to B. 4. Note that password minimum value doesn't change on hint text. 5. Apply patch. 6. Repeat patron creation, password minimum value should now change correctly. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Thx Emmi for fixing the "category change"! I believe this is a nice bug fix fixing the wrong information shown on the edit patron screen. I verified that the hint you get on using the "change password" feature is already correct. Showing a hint there always and not only when entering a wrong length one might be nice, but I think we can treat it as a separate enhancement.
Created attachment 116106 [details] [review] Bug 27430: Use password minimum length for patron category on password hint Hint for password minimum length should use minimum length set for patron category not "minPasswordLength" value. To test: 1. Set "minPasswordLength" e.g. 6 2. Set "Patron" category minimum password length e.g. 4 3. Create new a patron. 4. Note that hint after password input field reads "Minimum password length: 6" 5. Apply patch. 6. Hint should now read "Minimum password length: 4". Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 116107 [details] [review] Bug 27430: Change password minimum value hint when patron category is changed If patrons category is changed during add or edit password minimum value doesn't change. This patch adds ajax call to fix this. To test: 1. Add password minimum length for patron categories A and B. 2. Create a new patron with category A. 3. Change patrons category to B. 4. Note that password minimum value doesn't change on hint text. 5. Apply patch. 6. Repeat patron creation, password minimum value should now change correctly. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
In my understanding we never see <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div> as it's replaced by the JS code. Shouldn't we remove it then?
1573 [% IF categorycode %] 1574 update_category_code( "[% categorycode | html %]" ); 1575 [% ELSE %] 1576 if ( $("#categorycode_entry").length > 0 ){ 1577 var category_code = $("#categorycode_entry").find("option:selected").val(); 1578 update_category_code( category_code ); 1579 } 1580 [% END %] update_category_code COULD not be called on document.ready. But I am not sure we display the form without the category dropdown list. I will push as it, don't want to mess with this form.
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.03
Missing dependency, not backported to 20.05.x