Bug 39217 - Self checkout: Fix ugly error on wrong password when logging in
Summary: Self checkout: Fix ugly error on wrong password when logging in
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-28 14:50 UTC by Magnus Enger
Modified: 2025-04-22 06:50 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the error message on the self checkout login form (when the AutoSelfCheckAllowed system preference is used) so that it uses the same message as the regular OPAC when incorrect credentials are used. - Previous message: "The userid Koha::Patron=HASH(0x606447f6d868) was not found in the database. Please try again." - Updated error message: "You entered an incorrect username or password. Please try again! But note that passwords are case sensitive. Please contact a library staff member if you continue to have problems."
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39217: Fix ugly error on wrong password in SCO login (3.70 KB, patch)
2025-02-28 18:52 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39217: Fix ugly error on wrong password in SCO login (3.74 KB, patch)
2025-03-18 02:37 UTC, David Nind
Details | Diff | Splinter Review
Bug 39217: Fix ugly error on wrong password in SCO login (3.80 KB, patch)
2025-03-20 18:04 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39217: (follow-up) Break up text to improve spacing after tidy (3.53 KB, patch)
2025-03-25 13:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39217: Fix ugly error on wrong password in SCO login (3.85 KB, patch)
2025-04-16 16:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39217: (follow-up) Break up text to improve spacing after tidy (3.59 KB, patch)
2025-04-16 16:13 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2025-02-28 14:50:09 UTC
To reproduce: 

- WebBasedSelfCheck = Enable
- AutoSelfCheckAllowed = Allow
- AutoSelfCheckID = Valid username
- AutoSelfCheckPass = Valid password
- Go to OPAC/cgi-bin/koha/sco/sco-main.pl
- Login with valid username (e.g. "koha" in KTD) and wrong password
- Observe the error: "The userid Koha::Patron=HASH(0x606447f6d868) was not found in the database. Please try again."

It would probably be better without the "Koha::Patron=HASH(0x606447f6d868)" part.
Comment 1 Owen Leonard 2025-02-28 18:52:34 UTC
Created attachment 178870 [details] [review]
Bug 39217: Fix ugly error on wrong password in SCO login

This patch updates the self checkout page so that it uses the same
message as the regular OPAC in response to a user trying to log in with
incorrect credentials.

To test, apply the patch enable the self checkout module if necessary.

- Set the SelfCheckoutByLogin system preference to "cardnumber"
- Test the process of logging in as a patron to self checkout:
  Submitting an invalid library card number should trigger an error.
- Set the SelfCheckoutByLogin system preference to "username and
  password."
- Test this login form by submitting a valid card number or username and
  an invalid password. You should see the same error message.
- NOTE: If you submit an invalid card number or username you will get no
  message at all, which is a bug in and of itself.

QA note: I think the qa tool warning is an error in the tidy check.

Sponsored-by: Athens County Public Libraries
Comment 2 David Nind 2025-03-18 02:37:01 UTC
Created attachment 179419 [details] [review]
Bug 39217: Fix ugly error on wrong password in SCO login

This patch updates the self checkout page so that it uses the same
message as the regular OPAC in response to a user trying to log in with
incorrect credentials.

To test, apply the patch enable the self checkout module if necessary.

- Set the SelfCheckoutByLogin system preference to "cardnumber"
- Test the process of logging in as a patron to self checkout:
  Submitting an invalid library card number should trigger an error.
- Set the SelfCheckoutByLogin system preference to "username and
  password."
- Test this login form by submitting a valid card number or username and
  an invalid password. You should see the same error message.
- NOTE: If you submit an invalid card number or username you will get no
  message at all, which is a bug in and of itself.

QA note: I think the qa tool warning is an error in the tidy check.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Lucas Gass (lukeg) 2025-03-20 18:04:54 UTC
Created attachment 179564 [details] [review]
Bug 39217: Fix ugly error on wrong password in SCO login

This patch updates the self checkout page so that it uses the same
message as the regular OPAC in response to a user trying to log in with
incorrect credentials.

To test, apply the patch enable the self checkout module if necessary.

- Set the SelfCheckoutByLogin system preference to "cardnumber"
- Test the process of logging in as a patron to self checkout:
  Submitting an invalid library card number should trigger an error.
- Set the SelfCheckoutByLogin system preference to "username and
  password."
- Test this login form by submitting a valid card number or username and
  an invalid password. You should see the same error message.
- NOTE: If you submit an invalid card number or username you will get no
  message at all, which is a bug in and of itself.

QA note: I think the qa tool warning is an error in the tidy check.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Katrin Fischer 2025-03-21 16:34:59 UTC
Hm, this is not tidy in my environment. Please check your tools! :)
Comment 5 Katrin Fischer 2025-03-21 16:44:28 UTC
(In reply to Katrin Fischer from comment #4)
> Hm, this is not tidy in my environment. Please check your tools! :)

Hm when I tidy, I have this:

                                         >You entered an incorrect username or password. Please try again! But note that passwords are case
-                                        sensitive[% IF Koha.Preference('FailedLoginAttempts') %]and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you
+                                        sensitive[% IF Koha.Preference('FailedLoginAttempts') %]and that your account will be locked after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you
                                         continue to have problems.</p


And it defintiely feels lke the space before the and should have been kept. But: this is a bit of a translation issue overall. We should not "puzzle" sentences ideally. Leaving for Joubu to take a look.
Comment 6 Owen Leonard 2025-03-25 13:02:39 UTC
Created attachment 179683 [details] [review]
Bug 39217: (follow-up) Break up text to improve spacing after tidy
Comment 7 Katrin Fischer 2025-04-10 07:03:47 UTC
Please rebase!
Comment 8 Owen Leonard 2025-04-16 16:13:19 UTC
Created attachment 181032 [details] [review]
Bug 39217: Fix ugly error on wrong password in SCO login

This patch updates the self checkout page so that it uses the same
message as the regular OPAC in response to a user trying to log in with
incorrect credentials.

To test, apply the patch enable the self checkout module if necessary.

- Set the SelfCheckoutByLogin system preference to "cardnumber"
- Test the process of logging in as a patron to self checkout:
  Submitting an invalid library card number should trigger an error.
- Set the SelfCheckoutByLogin system preference to "username and
  password."
- Test this login form by submitting a valid card number or username and
  an invalid password. You should see the same error message.
- NOTE: If you submit an invalid card number or username you will get no
  message at all, which is a bug in and of itself.

QA note: I think the qa tool warning is an error in the tidy check.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 9 Owen Leonard 2025-04-16 16:13:22 UTC
Created attachment 181033 [details] [review]
Bug 39217: (follow-up) Break up text to improve spacing after tidy
Comment 10 Katrin Fischer 2025-04-22 06:50:04 UTC
Pushed for 25.05!

Well done everyone, thank you!