Bug 38772 - Typo 'minPasswordPreference' system preference
Summary: Typo 'minPasswordPreference' system preference
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Roman Dolny
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-23 09:52 UTC by Roman Dolny
Modified: 2025-04-24 09:20 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a typo in the code for OPAC password recovery - 'minPasswordPreference' to 'minPasswordLength' (the correct system preference name). It has no noticeable effect on resetting an account password from the OPAC.
Version(s) released in:
25.05.00,24.11.03,24.05.09,23.11.14
Circulation function:


Attachments
Bug 38772: Typo 'minPasswordPreference' system preference (1.45 KB, patch)
2024-12-23 10:17 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 38772: Typo 'minPasswordPreference' system preference (1.50 KB, patch)
2024-12-24 04:14 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dolny 2024-12-23 09:52:40 UTC
Typo in system preference 'minPasswordPreference' -> 'minPasswordLength' in opac/opac-password-recovery.pl
Comment 1 Roman Dolny 2024-12-23 10:17:26 UTC
Created attachment 175909 [details] [review]
Bug 38772: Typo 'minPasswordPreference' system preference

Typo in system preference 'minPasswordPreference' -> 'minPasswordLength'
in opac/opac-password-recovery.pl

There is no 'minPasswordPreference' system preference in database.
Bug 23816 added the capability to override minPasswordLength.

Test plan:
==========
1. Check 'minPasswordPreference' appearances:
   git grep -i 'minPasswordPreference' **/*
--> Note: only one in opac-password-recovery.pl; no one in sysprefs.sql
2. Apply the patch.
3. Repeat p. 1. Note there is not 'minPasswordPreference' at all.
Comment 2 David Nind 2024-12-24 04:14:36 UTC
Created attachment 175920 [details] [review]
Bug 38772: Typo 'minPasswordPreference' system preference

Typo in system preference 'minPasswordPreference' -> 'minPasswordLength'
in opac/opac-password-recovery.pl

There is no 'minPasswordPreference' system preference in database.
Bug 23816 added the capability to override minPasswordLength.

Test plan:
==========
1. Check 'minPasswordPreference' appearances:
   git grep -i 'minPasswordPreference' **/*
--> Note: only one in opac-password-recovery.pl; no one in sysprefs.sql
2. Apply the patch.
3. Repeat p. 1. Note there is not 'minPasswordPreference' at all.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-12-24 04:36:00 UTC
I've signed off, as it does appear to be a typo, and there is no minPasswordPreference system preference.

However, this change makes no difference in actually resetting your password.

Question for QA: So is this code still required/redundant/something else going on?

I tested the OPAC password recovery process before and after applying the patch, and it worked as expected.

I'm not a developer, so I have no idea how the underlying code works!

Testing notes (KTD):
1. In the staff interface, check that the minPasswordPreference system preference DOES NOT exist.
2. In the staff interface, check that minPasswordLength system preference DOES exist (default is set to 8).
3. Set OpacResetPassword system preference to "Allow".
4. Set up KTD so that you can send emails [1].
5. Add an email address to a patron, and change their credentials/password so that you can log in to the OPAC as that patron.
6. In the OPAC (logged out), select the "Forgot your password?" link, enter card number/user name, or email address.
7. Use the link in the email to reset the password.
8. Note that if the password length is less than the minimum length (before and after the patch), you can't reset your password unless it meets the minimum length.


[1]. To test sending emails using a Google account:
1. Set up an App password for your Google Account.
2. Configure a new 'SMTP Server' under 'Administration > SMTP servers'
   using the following settings, where `User name` = your Google email
   address and `Password` = your APP password, not your Google account
   password):

      Host: smtp.gmail.com
      Port: 587
      Timeout: 5
      SSL: STARTTLS
      User name: GOOGLEACCOUNTUSER
      Password: GOOGLEAPPPASSWORD
      Debug mode: Enabled
      Default server: selected
Comment 4 Katrin Fischer 2024-12-27 15:10:28 UTC
QA by RM.
Comment 5 Katrin Fischer 2024-12-27 16:37:05 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Paul Derscheid 2025-03-19 23:01:57 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.03
Comment 7 Wainui Witika-Park 2025-04-17 06:48:02 UTC
Applied to 24.05.x for 24.05.09
Comment 8 Fridolin Somers 2025-04-24 09:20:22 UTC
Pushed to 23.11.x for 23.11.14