Bug 13188 - Make it possible to configure mandatory patron data differently between OPAC registration and modification
Summary: Make it possible to configure mandatory patron data differently between OPAC ...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords: Manual
: 23891 24174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-03 14:49 UTC by Fridolin Somers
Modified: 2022-05-17 23:18 UTC (History)
16 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Adds the system preference PatronSelfModificationMandatoryField in order to separate borrower registration from borrower modification. Initial value is a copy of system preference PatronSelfRegistrationBorrowerMandatoryField.
Version(s) released in:
22.05.00


Attachments
Bug 13188: Add PatronSelfModificationMandatoryField system preference (4.36 KB, patch)
2021-01-19 22:42 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 13188: Add PatronSelfModificationMandatoryField system preference (5.42 KB, patch)
2021-01-19 22:44 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 13188: Add PatronSelfModificationMandatoryField system preference (5.16 KB, patch)
2021-01-29 23:45 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 13188: Add PatronSelfModificationMandatoryField system preference (5.19 KB, patch)
2021-07-09 14:54 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database (1.73 KB, patch)
2021-07-30 17:32 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 13188: Add PatronSelfModificationMandatoryField system preference (5.26 KB, patch)
2021-09-24 15:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database (1.80 KB, patch)
2021-09-24 15:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 13188: (QA follow-up) Modernise atomicupdate (2.14 KB, patch)
2021-09-24 15:26 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 13188: (RM follow-up) Several fixes on db changes (4.31 KB, patch)
2021-12-11 05:43 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 13188: Add PatronSelfModificationMandatoryField system preference (5.34 KB, patch)
2021-12-12 14:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database (1.86 KB, patch)
2021-12-12 14:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13188: (QA follow-up) Modernise atomicupdate (2.20 KB, patch)
2021-12-12 14:23 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13188: (RM follow-up) Several fixes on db changes (4.38 KB, patch)
2021-12-12 14:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13188: Fix alphabetic order in sysprefs.sql (1.93 KB, patch)
2021-12-12 14:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13188: (QA follow-up) Enhance list of field exclusions (2.18 KB, patch)
2021-12-12 14:24 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2014-11-03 14:49:11 UTC
For an registered patron, the page /cgi-bin/koha/opac-memberentry.pl displays his personal details and allow him to ask for a change.
In this page mandatory fields are wrong. It uses PatronSelfRegistrationBorrowerMandatoryField instead of BorrowerMandatoryField.
Comment 1 Katrin Fischer 2014-11-03 21:39:06 UTC
I am not sure if it's wrong - it seems like it might be intended behaviour. The library staff might have a different set of fields to fill out then the patron.
I am not sure, but i think it earlier versions we didn't check for mandatory fields at all.
Comment 2 Fridolin Somers 2014-11-04 17:11:02 UTC
(In reply to Katrin Fischer from comment #1)
> I am not sure if it's wrong - it seems like it might be intended behaviour.
> The library staff might have a different set of fields to fill out then the
> patron.
> I am not sure, but i think it earlier versions we didn't check for mandatory
> fields at all.

Indeed, but in case the preference PatronSelfRegistration is off, one should not have to configure the preference PatronSelfRegistrationBorrowerMandatoryField.
For me this preference only applies to the self-registration form.
Comment 3 Ola Andersson 2017-11-03 20:40:55 UTC
It is not possible with Koha 17.05.05 to configure a set of mandatory fields in SelfRegistration and at the same time configure another set of mandatory fields in SelfModification. This seems to be a design flaw.

E.g. we would like to have Address2 field mandatory in SelfRegistration but optional in SelfModification.
Comment 4 Katrin Fischer 2017-11-16 00:03:28 UTC
Hi Ola, have you seen PatronSelfModificationBorrowerUnwantedField?

I think this bug might be resolved with the newer preference.
Comment 5 Ola Andersson 2017-11-16 07:33:47 UTC
Hi Katrin! Yes I have seen PatronSelfModificationBorrowerUnwantedField. The problem is if you like us would like to keep Address2 field in both SelfRegistration and SelfModification but have it as an optional fields in SelfModification and a compulsory field in SelfRegistration. This configuration seems impossible with Koha settings.
Comment 6 Katrin Fischer 2017-12-05 06:46:20 UTC
Ah, I think I got it now. So we should differentiate between modification and registration for the mandatory fields as well:

PatronSelfRegistrationBorrowerUnwantedField
PatronSelfModificationBorrowerUnwantedField

PatronSelfRegistrationBorrowerMandatoryField
TODO: PatronSelfModificationBorrowerMandatoryField

Just wondering: why ask for it as mandatory on registration when it is not needed later on?
Comment 7 Ola Andersson 2017-12-05 09:33:14 UTC
Hi Katrin!

We would like to enable self registration to our employees only and they are required to enter their department in Address field 2.

However in the OPAC we have enabled self modification for all patrons and here address field 2 can be empty for patrons such as students.
Comment 8 Katrin Fischer 2017-12-05 10:29:49 UTC
Hi Ola, thx for explaining the use case!
Comment 9 Brian 2019-04-16 22:12:39 UTC
Any updates on bug 13188?

Carnegie team.
Comment 10 Magnus Enger 2019-06-12 08:25:32 UTC
A more or less related problem: If you set password as mandatory in PatronSelfRegistrationBorrowerMandatoryField it does not show up in the edit form (there is a separate screen for changing the password), and the edit form can never be submitted successfully. 

With a new syspref PatronSelfModificationBorrowerMandatoryField it would be possible to set it as not mandatory in the edit screen.
Comment 11 Séverine Queune 2019-10-28 10:57:11 UTC
(In reply to Magnus Enger from comment #10)
> A more or less related problem: If you set password as mandatory in
> PatronSelfRegistrationBorrowerMandatoryField it does not show up in the edit
> form (there is a separate screen for changing the password), and the edit
> form can never be submitted successfully. 
> 
> With a new syspref PatronSelfModificationBorrowerMandatoryField it would be
> possible to set it as not mandatory in the edit screen.

This peculiar problem with password field is very annoying (at BULAC, we experience it since we update in 18.05, was working on 16.11), shouldn't we open a new ticket to solve this specific point, if no one can work the new syspref ?
Comment 12 Katrin Fischer 2019-12-22 14:27:27 UTC
*** Bug 24174 has been marked as a duplicate of this bug. ***
Comment 13 Fridolin Somers 2020-11-16 14:28:11 UTC
PatronSelfModificationBorrowerMandatoryField looks as a strange name to me.

Maybe OpacBorrowerMandatoryField ?
Comment 14 Christopher Brannon 2020-11-16 15:44:48 UTC
(In reply to Fridolin Somers from comment #13)
> PatronSelfModificationBorrowerMandatoryField looks as a strange name to me.
> 
> Maybe OpacBorrowerMandatoryField ?

+1
Comment 15 Christopher Brannon 2020-11-16 15:45:04 UTC
(In reply to Fridolin Somers from comment #13)
> PatronSelfModificationBorrowerMandatoryField looks as a strange name to me.
> 
> Maybe OpacBorrowerMandatoryField ?

+1
Comment 16 Lucas Gass 2021-01-19 22:42:24 UTC Comment hidden (obsolete)
Comment 17 Lucas Gass 2021-01-19 22:44:53 UTC Comment hidden (obsolete)
Comment 18 Lucas Gass 2021-01-29 23:45:52 UTC
Created attachment 116085 [details] [review]
Bug 13188: Add PatronSelfModificationMandatoryField system preference

TEST PLAN:
1. Apply patch, updatedatabase, restart_all
2. In the  PatronSelfRegistrationBorrowerMandatoryField add the field password.
3. Go to the self registration page on make sure password is required.
4. Now go to the OPAC modification page, make some changes and attempt to submit. It should work.
5. Go to PatronSelfModificationMandatoryField and select some fields.
6. The columns you selected should now be required.
7. On the PatronSelfModificationMandatoryField page, make sure the select all and clear all buttons work.
Comment 19 sandboxes@biblibre.com 2021-07-09 14:54:49 UTC
Created attachment 122752 [details] [review]
Bug 13188: Add PatronSelfModificationMandatoryField system preference

TEST PLAN:
1. Apply patch, updatedatabase, restart_all
2. In the  PatronSelfRegistrationBorrowerMandatoryField add the field password.
3. Go to the self registration page on make sure password is required.
4. Now go to the OPAC modification page, make some changes and attempt to submit. It should work.
5. Go to PatronSelfModificationMandatoryField and select some fields.
6. The columns you selected should now be required.
7. On the PatronSelfModificationMandatoryField page, make sure the select all and clear all buttons work.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 20 Andrew Fuerste-Henry 2021-07-22 12:02:07 UTC
*** Bug 23891 has been marked as a duplicate of this bug. ***
Comment 21 David Cook 2021-07-29 04:35:42 UTC
Excited for this one
Comment 22 Nick Clemens 2021-07-30 11:10:25 UTC
The new pref should get the value from PatronSelfRegistrationBorrowerMandatoryField as default to preserve behaviour before the patch
Comment 23 Lucas Gass 2021-07-30 17:32:39 UTC
Created attachment 123335 [details] [review]
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database
Comment 24 Martin Renvoize 2021-09-24 15:26:45 UTC
Created attachment 125272 [details] [review]
Bug 13188: Add PatronSelfModificationMandatoryField system preference

TEST PLAN:
1. Apply patch, updatedatabase, restart_all
2. In the  PatronSelfRegistrationBorrowerMandatoryField add the field password.
3. Go to the self registration page on make sure password is required.
4. Now go to the OPAC modification page, make some changes and attempt to submit. It should work.
5. Go to PatronSelfModificationMandatoryField and select some fields.
6. The columns you selected should now be required.
7. On the PatronSelfModificationMandatoryField page, make sure the select all and clear all buttons work.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 Martin Renvoize 2021-09-24 15:26:49 UTC
Created attachment 125273 [details] [review]
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 26 Martin Renvoize 2021-09-24 15:26:54 UTC
Created attachment 125274 [details] [review]
Bug 13188: (QA follow-up) Modernise atomicupdate
Comment 27 Martin Renvoize 2021-09-24 15:27:24 UTC
Nice one.. Passing QA
Comment 28 Jonathan Druart 2021-11-02 13:55:57 UTC
Considering this a new enhancement. And postponing to 22.05, this script bring us too much mess this cycle.
Comment 29 Fridolin Somers 2021-12-11 05:42:53 UTC
Great enhancement but I found some issues in db changes
Comment 30 Fridolin Somers 2021-12-11 05:43:31 UTC
Created attachment 128409 [details] [review]
Bug 13188: (RM follow-up) Several fixes on db changes

Several issues with the atomic update:
 - File must to be .pl
 - File must be executable : chmod a+x
 - Syspref type is 'free' not 'multiple'

Small addition in atomic update:
I've added a print of syspref name and value,
this can be usefull for upgrade logs.

Also a minor issue in installer/data/mysql/mandatory/sysprefs.sql :
The description whas different from the atomic update.
I choose that atomic update is correct.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 31 Fridolin Somers 2021-12-11 05:48:06 UTC
Another point :

Since in opac.pref, syspref PatronSelfModificationBorrowerUnwantedField and PatronSelfRegistrationBorrowerMandatoryField contain :
exclusions: sort1|sort2

https://git.koha-community.org/Koha-community/Koha/src/commit/b0767f94d07950e7420deb901b208d131427c535/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref#L837

So should new syspref PatronSelfModificationMandatoryField ?
Comment 32 Fridolin Somers 2021-12-11 05:48:39 UTC
I'd like a new QA on this please.
Comment 33 Katrin Fischer 2021-12-12 14:23:46 UTC
Created attachment 128413 [details] [review]
Bug 13188: Add PatronSelfModificationMandatoryField system preference

TEST PLAN:
1. Apply patch, updatedatabase, restart_all
2. In the  PatronSelfRegistrationBorrowerMandatoryField add the field password.
3. Go to the self registration page on make sure password is required.
4. Now go to the OPAC modification page, make some changes and attempt to submit. It should work.
5. Go to PatronSelfModificationMandatoryField and select some fields.
6. The columns you selected should now be required.
7. On the PatronSelfModificationMandatoryField page, make sure the select all and clear all buttons work.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 34 Katrin Fischer 2021-12-12 14:23:51 UTC
Created attachment 128414 [details] [review]
Bug 13188: (follow-up) Get value from PatronSelfRegistrationBorrowerMandatoryField when updating database

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 35 Katrin Fischer 2021-12-12 14:23:56 UTC
Created attachment 128415 [details] [review]
Bug 13188: (QA follow-up) Modernise atomicupdate

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 36 Katrin Fischer 2021-12-12 14:24:01 UTC
Created attachment 128416 [details] [review]
Bug 13188: (RM follow-up) Several fixes on db changes

Several issues with the atomic update:
 - File must to be .pl
 - File must be executable : chmod a+x
 - Syspref type is 'free' not 'multiple'

Small addition in atomic update:
I've added a print of syspref name and value,
this can be usefull for upgrade logs.

Also a minor issue in installer/data/mysql/mandatory/sysprefs.sql :
The description whas different from the atomic update.
I choose that atomic update is correct.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 37 Katrin Fischer 2021-12-12 14:24:07 UTC
Created attachment 128417 [details] [review]
Bug 13188: Fix alphabetic order in sysprefs.sql

As a librarian I had to.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 38 Katrin Fischer 2021-12-12 14:24:12 UTC
Created attachment 128418 [details] [review]
Bug 13188: (QA follow-up) Enhance list of field exclusions

It doesn't make sense to allow for fields not visible in the
OPAC form to be made mandatory. This patch specifically adds:

* opacnote
* borrowernotes
* sort 1 and sort2 (missing only from Modification)

PatronSelfRegistrationBorrowerMandatoryField
exclusions: sort1|sort2|opacnote|borrowernotes

PatronSelfModificationMandatoryField
exclusions: password|cardnumber|dateexpiry|categorycode|sort1|sort2|opacnote|borrowernotes

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 39 Katrin Fischer 2021-12-12 14:25:34 UTC
I think the lists of exclusions have probably still some room for improvement, but this should be ok for now.
Comment 40 Fridolin Somers 2021-12-14 19:49:34 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 41 David Nind 2021-12-16 13:28:56 UTC
Added Manual keyword for 22.05 bugs that I consider require documentation changes. See bug 29640 and the linked spreadsheet for additional details.
Comment 42 David Cook 2022-05-17 23:10:46 UTC
I know it's too late, but I was thinking the other day that it would be nice to be able to have different mandatory fields for different patron types. 

The reason being that I've seen libraries workaround mandatory fields for some patron categories by inserting junk data (like '-' or 'N/A').

Of course, using a system preference for a default set of mandatory fields makes sense. 

Anyway, just food for thought.