Bug 27634 - Turn off patron self-registration if no default category is set
Summary: Turn off patron self-registration if no default category is set
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 27626 27650
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-05 10:19 UTC by Jonathan Druart
Modified: 2021-02-23 20:03 UTC (History)
3 users (show)

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


Attachments
Bug 27634: Turn off patron self-registration if no default category is set (3.60 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Force include categorycode to PatronSelfRegistrationBorrowerUnwantedField (1.26 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Add the ability to exclude fields from "modal" sysprefs (4.04 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Force include of dateexpiry (1.22 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Add a warning to the about page if PatronSelfRegistrationDefaultCategory not set (5.62 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Update PatronSelfRegistrationBorrowerUnwantedField's value (1.44 KB, patch)
2021-02-05 10:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27634: Fix Link on the OPAC main page (2.40 KB, patch)
2021-02-08 10:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-02-05 10:19:31 UTC
If there is no default category defined in PatronSelfRegistrationDefaultCategory the full feature must be displayed.

We already hide the link from the OPAC main page, but the form is still accessible.
Comment 1 Jonathan Druart 2021-02-05 10:47:27 UTC
Created attachment 116378 [details] [review]
Bug 27634: Turn off patron self-registration if no default category is set

If there is no default category defined in PatronSelfRegistrationDefaultCategory the full feature must be displayed.

We already hide the link from the OPAC main page, but the form is still accessible.

Test plan (for the whole patch set):
1. Turn on PatronSelfRegistration
2. Don't set PatronSelfRegistrationDefaultCategory
3. Go to the OPAC main page and confirm that the "Register here" link is
not displayed
4. Hit opac-memberentry.pl and confirm that you are redirected to the
OPAC main page
5. Go to the about page and confirm that you see a warning in the
"System information" tab
6. Set PatronSelfRegistrationDefaultCategory to an invalid patron's
category
7. Repeat 3, 4, 5
8. Set PatronSelfRegistrationDefaultCategory to a valid patron's
category
9. Self-register a patron and confirm it works as expected
10. Edit PatronSelfRegistrationBorrowerUnwantedField and confirm that
you cannot remove dateexpiry and categorycode
Comment 2 Jonathan Druart 2021-02-05 10:47:30 UTC
Created attachment 116379 [details] [review]
Bug 27634: Force include categorycode to PatronSelfRegistrationBorrowerUnwantedField

We should always use the category defined in
PatronSelfRegistrationDefaultCategory.
This could be discussed however.
Comment 3 Jonathan Druart 2021-02-05 10:47:33 UTC
Created attachment 116380 [details] [review]
Bug 27634: Add the ability to exclude fields from "modal" sysprefs
Comment 4 Jonathan Druart 2021-02-05 10:47:36 UTC
Created attachment 116381 [details] [review]
Bug 27634: Force include of dateexpiry

Otherwise we see a "Date expiry" entry in the form.
Comment 5 Jonathan Druart 2021-02-05 10:47:39 UTC
Created attachment 116382 [details] [review]
Bug 27634: Add a warning to the about page if PatronSelfRegistrationDefaultCategory not set
Comment 6 Jonathan Druart 2021-02-05 10:47:42 UTC
Created attachment 116383 [details] [review]
Bug 27634: Update PatronSelfRegistrationBorrowerUnwantedField's value
Comment 7 David Nind 2021-02-06 04:05:03 UTC
Sorry Jonathan!

For step 7-3, if I set an invalid patron category the registration link is displayed "Don't have an account? Register here.".

Everything else works as per the test plan.

I don't know hard it is to do, but could making a  PatronSelfRegistrationDefaultCategory a drop down list of existing patron category codes remove the problem of invalid patron codes? It may be out of scope for this bug though.

David
Comment 8 Jonathan Druart 2021-02-08 10:32:49 UTC
Created attachment 116491 [details] [review]
Bug 27634: Fix Link on the OPAC main page

Make sure the pref is filled with a valid patron's category to display
the "register" link
Comment 9 Jonathan Druart 2021-02-08 10:33:42 UTC
(In reply to David Nind from comment #7)
> Sorry Jonathan!

No worries, thanks for testing, David!

> For step 7-3, if I set an invalid patron category the registration link is
> displayed "Don't have an account? Register here.".

Fixed!

> I don't know hard it is to do, but could making a 
> PatronSelfRegistrationDefaultCategory a drop down list of existing patron
> category codes remove the problem of invalid patron codes? It may be out of
> scope for this bug though.

That can be done quite easily I think. You should open a new bug report :)
Comment 10 Owen Leonard 2021-02-08 12:37:12 UTC
> > I don't know hard it is to do, but could making a 
> > PatronSelfRegistrationDefaultCategory a drop down list of existing patron
> > category codes remove the problem of invalid patron codes? It may be out of
> > scope for this bug though.
> 
> That can be done quite easily I think. You should open a new bug report :)

Bug 27652
Comment 11 David Nind 2021-02-23 20:03:45 UTC
I was too slow retesting, the patch no longer applies 8-(

...
Applying: Bug 27634: Turn off patron self-registration if no default category is set
error: sha1 information is lacking or useless (opac/opac-memberentry.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 27634: Turn off patron self-registration if no default category is set
...