[Koha-bugs] [Bug 32426] Allow plugin to generate userid when creating patrons

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Feb 20 12:50:41 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426

--- Comment #9 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 146954
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146954&action=edit
Bug 32426: [DO NOT PUSH] Introduce example plugin

RM: Do not push this patch!

A very simple plugin; it just returns the borrowers.email field, assuming
that you made this field mandatory.
It should check uniqueness, provide an alternative; for simplicity
that is not included here.

Test plan:
NOTE: Some unit tests may fail when applying this patch/installing this
plugin. That's no problem; this example plugin just serves as POC.

Install the plugin. You could just run:
* perl -MKoha::Plugin::Example::Userid_email
-e"Koha::Plugin::Example::Userid_email->new->install"

Run t/db_dependent/Koha/Patron_generate_userid.t. This should pass.

Enter a new patron via OPAC self registration; try existing and new email
address.
Toggle PatronSelfRegistrationVerifyByEmail. Try again (existing, new).
Go to staff memberentry page.
Add new patron with new email address. (Leave userid empty.)
Verify the newly generated userid after saving.
Try to add another patron with the same email. You should see an alert.
Edit an existing patron. Try new and existing email address.
When editing, clear userid and save. Check result.

Uninstall the plugin.
* perl -MKoha::Plugin::Example::Userid_email
-e"Koha::Plugin::Example::Userid_email->new->uninstall"

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list