[Bug 32426] New: Allow plugin to generate userid when creating patrons
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Bug ID: 32426 Summary: Allow plugin to generate userid when creating patrons Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com See also bug 29480 and its old predecessor 2237 for an email based userid. I will give a try here in doing this via Koha plugins and hence providing more flexibility. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29480 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAKE_PATRON CODE (memberentry.pl) my $fake_patron = Koha::Patron->new; $fake_patron->userid($patron->userid) if $patron; # editing if ( ( defined $newdata{'firstname'} || $category_type eq 'I' ) && ( defined $newdata{'surname'} ) ) { # Full page edit, firstname and surname input zones are present $fake_patron->firstname($newdata{firstname}); $fake_patron->surname($newdata{surname}); $fake_patron->generate_userid; $newdata{'userid'} = $fake_patron->userid; => We should remove this code and leave userid to patron->store now imo. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146947 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146947&action=edit Bug 32426: Patron::generate_userid - add plugin hook The hook is called patron_generate_userid. How suitable. The existing generate_userid tests and new tests with mocked plugins are merged into a new test script. Test plan: Run t/db_dependent/Koha/Patron_generate_userid.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146948 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146948&action=edit Bug 32426: Throw InvalidUserid exception in Patron->store When creating we still call generate_userid and verify the result. When modifying we do not accept an invalid userid. When needed, we recreate the userid; this should be very exceptional. Test plan: Run t/db_dependent/Koha/Patrons.t Go to staff interface. Try changing userid of a patron to an existing one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146949 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146949&action=edit Bug 32426: Changes for opac-memberentry Test plan: Enable self registration, pick a default category too for it. The changes will be tested later with a plugin, but now change Koha/Patron.pm as follows: sub _generate_userid_legacy { # as we always did my ($self) = @_; +return $self; So, add the return $self line only. Restart all. Try to register an account on OPAC. You should see an alert about problems processing your registration. Undo the change in Patron.pm and restart all. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146950 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146950&action=edit Bug 32426: Changes for opac-registration-verify Similar to changes in opac-memberentry. Test plan: Now also enable PatronSelfRegistrationVerifyByEmail. Make the same change in Patron again with return $self. Restart all. Self register. Check your email. Follow the link. Verify that you have a similar alert. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146951 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146951&action=edit Bug 32436: Changes for members/memberentry.pl Test plan: Note: We will address this again when installing a plugin, but first we test with the legacy userid code. Add a new user with members/memberentry in staff. Edit this user, change userid in staff. Try full form and partial one. If you remove userid or replace by a space (when mandatory), Koha should regenerate a legacy userid. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146952 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146952&action=edit Bug 32426: Adjust error message of ERROR_login_exist The reference to password might be confusing. You could have the same password as another user. The addition of 'could not create unique one' especially applies to plugins that return an existing userid, like the very simple plugin example on the Bugzilla report that just returns borrowers.email. Test plan: Covered by previous patch. Just a string change here. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 146953 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146953&action=edit Bug 32426: Fix qatools issues [1] opac-registration-verify.pl forbidden pattern: Script permissions is authnotrequired => 1, it is correct for an OPAC script, not intranet (bug 24663) => Do not go back to authrequired => 1. Use a check on OpacPublic. [2] opac-registration-invalid.tt missing_filter at line 41 (<p>Error [% error_type %]: [% error_info %]</p>) [3] opac-memberentry.tt missing_filter at line 131 (<p>Error [% error_type %]: [% error_info %]</p>) Test plan: Verify that qatools passes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #9 from Marcel de Rooy <m.de.rooy@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@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146951|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147252&action=edit Bug 32426: Changes for members/memberentry.pl Test plan: Note: We will address this again when installing a plugin, but first we test with the legacy userid code. Add a new user with members/memberentry in staff. Edit this user, change userid in staff. Try full form and partial one. If you remove userid or replace by a space (when mandatory), Koha should regenerate a legacy userid. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146952|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147253&action=edit Bug 32426: Adjust error message of ERROR_login_exist The reference to password might be confusing. You could have the same password as another user. The addition of 'could not create unique one' especially applies to plugins that return an existing userid, like the very simple plugin example on the Bugzilla report that just returns borrowers.email. Test plan: Covered by previous patch. Just a string change here. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146953|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147254&action=edit Bug 32426: Fix qatools issues [1] opac-registration-verify.pl forbidden pattern: Script permissions is authnotrequired => 1, it is correct for an OPAC script, not intranet (bug 24663) => Do not go back to authrequired => 1. Use a check on OpacPublic. [2] opac-registration-invalid.tt missing_filter at line 41 (<p>Error [% error_type %]: [% error_info %]</p>) [3] opac-memberentry.tt missing_filter at line 131 (<p>Error [% error_type %]: [% error_info %]</p>) Test plan: Verify that qatools passes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146954|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 147255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147255&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@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Bug number in 5th patch corrected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #146947|0 |1 is obsolete| | Attachment #146948|0 |1 is obsolete| | Attachment #146949|0 |1 is obsolete| | Attachment #146950|0 |1 is obsolete| | Attachment #147252|0 |1 is obsolete| | Attachment #147253|0 |1 is obsolete| | Attachment #147254|0 |1 is obsolete| | Attachment #147255|0 |1 is obsolete| | --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147704&action=edit Bug 32426: Patron::generate_userid - add plugin hook The hook is called patron_generate_userid. How suitable. The existing generate_userid tests and new tests with mocked plugins are merged into a new test script. Test plan: Run t/db_dependent/Koha/Patron_generate_userid.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147705&action=edit Bug 32426: Throw InvalidUserid exception in Patron->store When creating we still call generate_userid and verify the result. When modifying we do not accept an invalid userid. When needed, we recreate the userid; this should be very exceptional. Test plan: Run t/db_dependent/Koha/Patrons.t Go to staff interface. Try changing userid of a patron to an existing one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147706 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147706&action=edit Bug 32426: Changes for opac-memberentry Test plan: Enable self registration, pick a default category too for it. The changes will be tested later with a plugin, but now change Koha/Patron.pm as follows: sub _generate_userid_legacy { # as we always did my ($self) = @_; +return $self; So, add the return $self line only. Restart all. Try to register an account on OPAC. You should see an alert about problems processing your registration. Undo the change in Patron.pm and restart all. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147707&action=edit Bug 32426: Changes for opac-registration-verify Similar to changes in opac-memberentry. Test plan: Now also enable PatronSelfRegistrationVerifyByEmail. Make the same change in Patron again with return $self. Restart all. Self register. Check your email. Follow the link. Verify that you have a similar alert. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147708 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147708&action=edit Bug 32426: Changes for members/memberentry.pl Test plan: Note: We will address this again when installing a plugin, but first we test with the legacy userid code. Add a new user with members/memberentry in staff. Edit this user, change userid in staff. Try full form and partial one. If you remove userid or replace by a space (when mandatory), Koha should regenerate a legacy userid. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147709 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147709&action=edit Bug 32426: Adjust error message of ERROR_login_exist The reference to password might be confusing. You could have the same password as another user. The addition of 'could not create unique one' especially applies to plugins that return an existing userid, like the very simple plugin example on the Bugzilla report that just returns borrowers.email. Test plan: Covered by previous patch. Just a string change here. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147710 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147710&action=edit Bug 32426: Fix qatools issues [1] opac-registration-verify.pl forbidden pattern: Script permissions is authnotrequired => 1, it is correct for an OPAC script, not intranet (bug 24663) => Do not go back to authrequired => 1. Use a check on OpacPublic. [2] opac-registration-invalid.tt missing_filter at line 41 (<p>Error [% error_type %]: [% error_info %]</p>) [3] opac-memberentry.tt missing_filter at line 131 (<p>Error [% error_type %]: [% error_info %]</p>) Test plan: Verify that qatools passes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147711 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147711&action=edit Bug 32426: (follow-up) Use more acurate term 'internal' instead of 'legacy' Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #23 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147712&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@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Kyle M Hall from comment #23)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Great, Kyle. Thx -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147704|0 |1 is obsolete| | --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148203&action=edit Bug 32426: Patron::generate_userid - add plugin hook The hook is called patron_generate_userid. How suitable. The existing generate_userid tests and new tests with mocked plugins are merged into a new test script. Test plan: Run t/db_dependent/Koha/Patron_generate_userid.t Run t/db_dependent/Koha/Patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147705|0 |1 is obsolete| | --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148204 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148204&action=edit Bug 32426: Throw InvalidUserid exception in Patron->store When creating we still call generate_userid and verify the result. When modifying we do not accept an invalid userid. When needed, we recreate the userid; this should be very exceptional. Test plan: Run t/db_dependent/Koha/Patrons.t Go to staff interface. Try changing userid of a patron to an existing one. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147706|0 |1 is obsolete| | --- Comment #27 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148205&action=edit Bug 32426: Changes for opac-memberentry Test plan: Enable self registration, pick a default category too for it. The changes will be tested later with a plugin, but now change Koha/Patron.pm as follows: sub _generate_userid_legacy { # as we always did my ($self) = @_; +return $self; So, add the return $self line only. Restart all. Try to register an account on OPAC. You should see an alert about problems processing your registration. Undo the change in Patron.pm and restart all. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147707|0 |1 is obsolete| | --- Comment #28 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148206&action=edit Bug 32426: Changes for opac-registration-verify Similar to changes in opac-memberentry. Test plan: Now also enable PatronSelfRegistrationVerifyByEmail. Make the same change in Patron again with return $self. Restart all. Self register. Check your email. Follow the link. Verify that you have a similar alert. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147708|0 |1 is obsolete| | --- Comment #29 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148207&action=edit Bug 32426: Changes for members/memberentry.pl Test plan: Note: We will address this again when installing a plugin, but first we test with the legacy userid code. Add a new user with members/memberentry in staff. Edit this user, change userid in staff. Try full form and partial one. If you remove userid or replace by a space (when mandatory), Koha should regenerate a legacy userid. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147709|0 |1 is obsolete| | --- Comment #30 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148208 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148208&action=edit Bug 32426: Adjust error message of ERROR_login_exist The reference to password might be confusing. You could have the same password as another user. The addition of 'could not create unique one' especially applies to plugins that return an existing userid, like the very simple plugin example on the Bugzilla report that just returns borrowers.email. Test plan: Covered by previous patch. Just a string change here. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147710|0 |1 is obsolete| | --- Comment #31 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148209&action=edit Bug 32426: Fix qatools issues [1] opac-registration-verify.pl forbidden pattern: Script permissions is authnotrequired => 1, it is correct for an OPAC script, not intranet (bug 24663) => Do not go back to authrequired => 1. Use a check on OpacPublic. [2] opac-registration-invalid.tt missing_filter at line 41 (<p>Error [% error_type %]: [% error_info %]</p>) [3] opac-memberentry.tt missing_filter at line 131 (<p>Error [% error_type %]: [% error_info %]</p>) Test plan: Verify that qatools passes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147711|0 |1 is obsolete| | --- Comment #32 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148210 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148210&action=edit Bug 32426: (follow-up) Use more acurate term 'internal' instead of 'legacy' Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147712|0 |1 is obsolete| | --- Comment #33 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 148211 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148211&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@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #34 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All works well and as designed.. no regressions found and unit tests all present and correct. I'm also happy to see some area's cleaned up a little in this patchset. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #35 from Fridolin Somers <fridolin.somers@biblibre.com> --- This is great, added to : https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks#Under_development_hoo... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #36 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I like this. And have a question I've been munging about this kind of hooks for a while: What if there are two plugins that implement the hook? Not asking for this bug to solve it but, should we have a way to define some precedence between them, and make it work in a way that is not just alphabetically? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |new feature Summary|Allow plugin to generate |Make userid generation |userid when creating |pluggable |patrons | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #37 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #36)
I like this. And have a question I've been munging about this kind of hooks for a while:
What if there are two plugins that implement the hook? Not asking for this bug to solve it but, should we have a way to define some precedence between them, and make it work in a way that is not just alphabetically?
Yes, I thought about that too. I think that it is not even alphabetical but database order. Bug 32449. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #38 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Marcel and I discussed exactly that on IRC when I was QAing this as it happens. We could do with a few refinements around the plugin system as a whole. Setting a precedence order to apply transforms like this is exactly one of the cases we were thinking about. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #39 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #40 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas: I will check those 3 failures now: t_db_dependent_Members_t.Koha::Patron->store should not update userid if not true (78) t_db_dependent_api_v1_patrons_t.add() tests (1689) t_db_dependent_api_v1_patrons_t.update() tests (1689) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #41 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148782 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148782&action=edit Bug 32426: (follow-up) Fix for Members.t / Patrons.t Moving and adjusting test in Member.t. Test plan: Run both tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #42 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- API patch forthcoming -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #43 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 148793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148793&action=edit Bug 32426: (follow-up) Fix api/v1/patrons.t We use another exception now. Test plan: Run t/db_dependent/api/v1/patrons.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 --- Comment #44 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas: Should be okay now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #45 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #44)
Tomas: Should be okay now.
Thanks for taking care, Marcel. Good job! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Needs documenting CC| |matt.blenkinsop@ptfs-europe | |.com --- Comment #46 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | Text to go in the| |This adds a new plugin hook release notes| |`patron_generate_userid` | |that allows to have a | |custom method for | |generating the userid on a | |patron record. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |caroline.cyr-la-rose@inlibr | |o.com Status|Needs documenting |RESOLVED --- Comment #47 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Plugin hooks are not documented in the manual. I see that this one is already mentioned here https://wiki.koha-community.org/wiki/Koha_Plugin_Hooks Unless there is somewhere else this should be documented, I think we can close it. Feel free to reopen with more details, if necessary. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32426 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36170 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36170 [Bug 36170] Wrong warning in memberentry -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org