Bug 23816: (QA follow-up) Use existing form validation to validate min password length
authorKatrin Fischer <katrin.fischer.83@web.de>
Thu, 27 Aug 2020 18:07:16 +0000 (20:07 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 9 Sep 2020 13:39:52 +0000 (15:39 +0200)
The pattern check didn't work for me, but I figured we might
want to use the same validation as for the other numeric fields
on the form instead (upper age limit, etc.)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt
koha-tmpl/intranet-tmpl/prog/js/categories.js

index 99dac40..37c6687 100644 (file)
                 </li>
                 <li>
                     <label for="min_password_length">Minimum password length:</label>
-                    <input id="min_password_length" type="text" inputmode="numeric" pattern="[0-9]*" name="min_password_length" value="[% category.min_password_length | html %]"/>
+                    <input id="min_password_length" type="text" inputmode="numeric" name="min_password_length" value="[% category.min_password_length | html %]"/>
                     <span>Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])</span>
                 </li>
                 <li class="pwd_setting_wrapper">
index 4b6ac15..8031fff 100644 (file)
@@ -84,6 +84,9 @@ $(document).ready(function() {
             },
             category_type: {
                 required: true
+            },
+            min_password_length: {
+                digits: true
             }
         },
         messages: {