Bug 36430 - Allow self-registering users to set their own userid
Summary: Allow self-registering users to set their own userid
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Sam Lau
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-26 14:14 UTC by Lucas Gass (lukeg)
Modified: 2024-09-26 15:13 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36430: Allow self-reg users to set userid (5.58 KB, patch)
2024-08-05 18:16 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 36430: Allow self-reg users to set userid (5.63 KB, patch)
2024-09-26 14:49 UTC, Shi Yao Wang
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2024-03-26 14:14:52 UTC
User's should be able to set their own userid via self registration, currently one cannot. There would need to be a check for uniqueness.
Comment 1 Sam Lau 2024-08-05 18:16:06 UTC
Created attachment 170075 [details] [review]
Bug 36430: Allow self-reg users to set userid

This patch adds the ability for patrons to set their userid when self registering. It also gives patrons the ability to request changes to their user id from the OPAC.

To test:
1) Apply patch, restart_all
2) Make sure the 'PatronSelfRegistration' system pref is set to allow and make sure you have a 'PatronSelfRegistrationDefaultCategory' category set.
3) Visit the OPAC main page and select 'Create an account'
4) Under the 'Library' section, you should see a new 'Username: ' input. Fill out the required information and leave the username blank.
5) Submit the form. Your userid should automatically be set. Copy/remember this userid that was given to you
6) Create a new account, this time fill in a custom userid with the value given to the patron you just created
7) When submitting, you will see an error message, as the userid is not unique.
8) Change the userid to somethign different and submit the form.
9) Form submits successfully and gives you the desired userid. Log into this account
10) Click the 'Personal details' tab and submit an update request for the username. Ensure this works correctly.
11) Play around with the other self registration system preferences ('PatronSelfRegistration'...) to attempt to hide/require the userid field and ensure they all work properly.
Comment 2 Shi Yao Wang 2024-09-26 14:49:23 UTC
Created attachment 171981 [details] [review]
Bug 36430: Allow self-reg users to set userid

This patch adds the ability for patrons to set their userid when self registering. It also gives patrons the ability to request changes to their user id from the OPAC.

To test:
1) Apply patch, restart_all
2) Make sure the 'PatronSelfRegistration' system pref is set to allow and make sure you have a 'PatronSelfRegistrationDefaultCategory' category set.
3) Visit the OPAC main page and select 'Create an account'
4) Under the 'Library' section, you should see a new 'Username: ' input. Fill out the required information and leave the username blank.
5) Submit the form. Your userid should automatically be set. Copy/remember this userid that was given to you
6) Create a new account, this time fill in a custom userid with the value given to the patron you just created
7) When submitting, you will see an error message, as the userid is not unique.
8) Change the userid to somethign different and submit the form.
9) Form submits successfully and gives you the desired userid. Log into this account
10) Click the 'Personal details' tab and submit an update request for the username. Ensure this works correctly.
11) Play around with the other self registration system preferences ('PatronSelfRegistration'...) to attempt to hide/require the userid field and ensure they all work properly.

Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com>
Comment 3 Shi Yao Wang 2024-09-26 14:55:22 UTC
Does work, but there is an issue:
a patron requests to change his/her username to an existing username -> the request goes through -> the library staff accepts the change in the staff interface -> error 500 page

Still going to sign-off
Comment 4 Lucas Gass (lukeg) 2024-09-26 15:13:41 UTC
(In reply to Shi Yao Wang from comment #3)
> Does work, but there is an issue:
> a patron requests to change his/her username to an existing username -> the
> request goes through -> the library staff accepts the change in the staff
> interface -> error 500 page
> 
> Still going to sign-off

Should probably throw an exception at the script level? I think this is enough of a problem to FQA. 

Good catch!