This plugin generates a patron userid following the pattern {prefix}{MAX(borrowernumber)+1} for configured patron categories.
- Koha ^23.05.x
When a patron is created or their userid is (re)generated, the plugin checks whether the patron's category is in the configured list. If so, it generates the userid as the configured prefix followed by the current maximum borrowernumber incremented by one. For all other categories, Koha's default userid generation applies.
Once the plugin is installed, you can access the plugin's configuration in the Koha's plugins home page.
- find the Plugin Generate Userid plugin in the table
- click on Action -> configure
- select one or more patron categories to which the rule applies
- set the prefix (e.g.
USR,LIB, leave blank for a numeric-only userid) - save
- Once the plugin is enabled, it handles userid generation for all patrons -- including those in unconfigured categories (using the standard
firstname.lastnamealgorithm). This is a Koha constraint: when a plugin is active for this hook, Koha does not fall back to its own generator. - If two patrons in a configured category are created simultaneously, both may receive the same candidate userid. Koha checks uniqueness after generation; if the userid is already taken the patron will end up with no userid and the save will fail.
- Changing the prefix after patrons have already been created does not retroactively update existing userids.