Bug 38549 - Make create_superlibrarian.pl script accept a name parameter
Summary: Make create_superlibrarian.pl script accept a name parameter
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on: 37368
Blocks:
  Show dependency treegraph
 
Reported: 2024-11-29 00:25 UTC by Aleisha Amohia
Modified: 2025-09-11 00:30 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement enables the user to supply a surname parameter when creating a superlibrarian user via the commandline create_superlibrarian.pl script. Koha patrons MUST have a name, so if no surname is provided, the userid will be used for the surname instead.
Version(s) released in:
Circulation function:


Attachments
Bug 38549: Provide surname for create_superlibrarian.pl (3.12 KB, patch)
2025-09-11 00:29 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2024-11-29 00:25:42 UTC
As reported in Bug 37368, patron searches break if there are patrons with no firstname AND no surname.

We often use the create_superlibrarian.pl script to create Koha admin users. Sometimes we forget to edit the patron record and add a firstname/surname. That's now causing these errors as seen in Bug 37368.

create_superlibrarian.pl should accept firstname and surname parameters and require at least one of either.
Comment 1 Fridolin Somers 2024-12-19 13:21:46 UTC
When name not provided we may use uppercase userid
My 2c
Comment 2 Aleisha Amohia 2025-09-11 00:29:47 UTC
Created attachment 186350 [details] [review]
Bug 38549: Provide surname for create_superlibrarian.pl

Interestingly this script already had a $surname variable, just never accepted a parameter for it.

This enhancement enables the user to supply a surname parameter when creating a superlibrarian user via the commandline create_superlibrarian.pl script. Koha patrons MUST have a name, so if no surname is provided, the userid will be used for the surname instead.

To test:

1. Apply the patch and restart services
2. Attempt to create a superlibrarian with no surname provided.
  In KTD: misc/devel/create_superlibrarian.pl --userid test --cardnumber test --password XXXX --branchcode CPL --categorycode S
3. Search for your patron in Koha. Confirm the surname was automatically set to the userid 'test'
4. Attempt to create a superlibrarian, this time provide a surname that is different from the userid so easy to tell apart.
  In KTD: misc/devel/create_superlibrarian.pl --userid test1 --cardnumber test1 --password XXXX --branchcode CPL --categorycode S --surname testsurname
5. Search for your patron in Koha. Confirm the surname was set correctly using the given surname.

Sponsored-by: Catalyst IT