Bug 21192

Summary: Borrower Fields on OPAC's Personal Details Screen Use Self Register Field Options Incorrectly
Product: Koha Reporter: Chris Slone <cslone>
Component: OPACAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Julian Maurice <julian.maurice>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jonathan.druart, julian.maurice, kohadevinim, lucas, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14658    
Bug Blocks:    
Attachments: Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification

Description Chris Slone 2018-08-09 14:42:40 UTC
If a patron is logged into the OPAC and they attempt to submit changes to their personal details without having actually changed anything, the page reloads with a message stating 'No changes were made.' However, the fields that now appear are those that have been allowed/hidden according to the preferences set for patron self registration, even if patron self registration is disabled. This can lead to problems if there are discrepancies between the fields allowed for self register settings and those allowed for patron self modification settings.

To replicate:

1.) In Administration › System preferences > OPAC, set PatronSelfRegistration to 'don't allow'

2.) Modify the unwanted fields for PatronSelfModificationBorrowerUnwantedField and PatronSelfRegistrationBorrowerUnwantedField so that at least one field is different between the two settings and save (for example, specify 'mobile' to be hidden in the former, but don't include in the list of fields to be hidden in the latter).

3.) Log into the OPAC and navigate to the 'your personal details' tab. Notice that the editable fields correspond to those not hidden by PatronSelfModificationBorrowerUnwantedField

4.) Without making any changes, click on 'Submit update request'.

5.) Note that on this page the fields correspond to those not hidden by PatronSelfRegistrationBorrowerUnwantedField and are now editable (including any fields that would otherwise be hidden by the Self Modification settings).
Comment 1 Jonathan Druart 2018-08-13 15:59:48 UTC
Created attachment 77760 [details] [review]
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification

There was a mix up between "modification" and "edit" for $action in
opac-memberentry.pl.

If a patron is logged into the OPAC and they attempt to submit changes to their
personal details without having actually changed anything, the page reloads with
a message stating 'No changes were made.' However, the fields that now appear
are those that have been allowed/hidden according to the preferences set for
patron self registration, even if patron self registration is disabled. This can
lead to problems if there are discrepancies between the fields allowed for self
register settings and those allowed for patron self modification settings.

To replicate:

1.) In Administration › System preferences > OPAC, set PatronSelfRegistration to
'don't allow'

2.) Modify the unwanted fields for PatronSelfModificationBorrowerUnwantedField
and PatronSelfRegistrationBorrowerUnwantedField so that at least one field is
different between the two settings and save (for example, specify 'mobile' to be
hidden in the former, but don't include in the list of fields to be hidden in
the latter).

3.) Log into the OPAC and navigate to the 'your personal details' tab. Notice
that the editable fields correspond to those not hidden by
PatronSelfModificationBorrowerUnwantedField

4.) Without making any changes, click on 'Submit update request'.

5.) Note that on this page the fields correspond to those not hidden by
PatronSelfRegistrationBorrowerUnwantedField and are now editable (including any
fields that would otherwise be hidden by the Self Modification settings).
Comment 2 Caroline Cyr La Rose 2018-09-16 18:02:31 UTC
The behaviour is not changed with the patch. When I click submit changes, new fields appear anyway, even after I apply the patch... Do I have to restart something?
Comment 3 Jonathan Druart 2018-09-16 18:48:28 UTC
Created attachment 78980 [details] [review]
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification

There was a mix up between "modification" and "edit" for $action in
opac-memberentry.pl.

If a patron is logged into the OPAC and they attempt to submit changes to their
personal details without having actually changed anything, the page reloads with
a message stating 'No changes were made.' However, the fields that now appear
are those that have been allowed/hidden according to the preferences set for
patron self registration, even if patron self registration is disabled. This can
lead to problems if there are discrepancies between the fields allowed for self
register settings and those allowed for patron self modification settings.

To replicate:

1.) In Administration › System preferences > OPAC, set PatronSelfRegistration to
'don't allow'

2.) Modify the unwanted fields for PatronSelfModificationBorrowerUnwantedField
and PatronSelfRegistrationBorrowerUnwantedField so that at least one field is
different between the two settings and save (for example, specify 'mobile' to be
hidden in the former, but don't include in the list of fields to be hidden in
the latter).

3.) Log into the OPAC and navigate to the 'your personal details' tab. Notice
that the editable fields correspond to those not hidden by
PatronSelfModificationBorrowerUnwantedField

4.) Without making any changes, click on 'Submit update request'.

5.) Note that on this page the fields correspond to those not hidden by
PatronSelfRegistrationBorrowerUnwantedField and are now editable (including any
fields that would otherwise be hidden by the Self Modification settings).
Comment 4 Jonathan Druart 2018-09-16 18:49:08 UTC
PatronSelfModificationBorrowerUnwantedField
title|othernames|initials|country|fax|emailpro|phonepro|B_streetnumber|B_streettype|B_address|B_address2|B_city|B_state|B_zipcode|B_country|B_email|B_phone|altcontactfirstname|altcontactsurname|altcontactaddress1|altcontactaddress2|altcontactaddress3|altcontactstate|altcontactzipcode|altcontactcountry|altcontactphone

PatronSelfRegistrationBorrowerUnwantedField
title|othernames|initials|country|fax|emailpro|phonepro|B_streetnumber|B_streettype|B_address|B_address2|B_city|B_state|B_zipcode|B_country|B_email|B_phone|altcontactfirstname|altcontactsurname|altcontactphone
Comment 5 Devinim 2018-12-10 14:13:06 UTC
Created attachment 83017 [details] [review]
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification

There was a mix up between "modification" and "edit" for $action in
opac-memberentry.pl.

If a patron is logged into the OPAC and they attempt to submit changes to their
personal details without having actually changed anything, the page reloads with
a message stating 'No changes were made.' However, the fields that now appear
are those that have been allowed/hidden according to the preferences set for
patron self registration, even if patron self registration is disabled. This can
lead to problems if there are discrepancies between the fields allowed for self
register settings and those allowed for patron self modification settings.

To replicate:

1.) In Administration › System preferences > OPAC, set PatronSelfRegistration to
'don't allow'

2.) Modify the unwanted fields for PatronSelfModificationBorrowerUnwantedField
and PatronSelfRegistrationBorrowerUnwantedField so that at least one field is
different between the two settings and save (for example, specify 'mobile' to be
hidden in the former, but don't include in the list of fields to be hidden in
the latter).

3.) Log into the OPAC and navigate to the 'your personal details' tab. Notice
that the editable fields correspond to those not hidden by
PatronSelfModificationBorrowerUnwantedField

4.) Without making any changes, click on 'Submit update request'.

5.) Note that on this page the fields correspond to those not hidden by
PatronSelfRegistrationBorrowerUnwantedField and are now editable (including any
fields that would otherwise be hidden by the Self Modification settings).

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Comment 6 Devinim 2018-12-10 14:20:05 UTC
(In reply to Caroline Cyr La Rose from comment #2)
> The behaviour is not changed with the patch. When I click submit changes,
> new fields appear anyway, even after I apply the patch... Do I have to
> restart something?

You can try to restart Plack.

sudo koha-plack --restart kohadev
Comment 7 Julian Maurice 2019-01-18 14:52:45 UTC
Created attachment 84196 [details] [review]
Bug 21192: Do not pick SelfRegistration hidden fields for SelfModification

There was a mix up between "modification" and "edit" for $action in
opac-memberentry.pl.

If a patron is logged into the OPAC and they attempt to submit changes to their
personal details without having actually changed anything, the page reloads with
a message stating 'No changes were made.' However, the fields that now appear
are those that have been allowed/hidden according to the preferences set for
patron self registration, even if patron self registration is disabled. This can
lead to problems if there are discrepancies between the fields allowed for self
register settings and those allowed for patron self modification settings.

To replicate:

1.) In Administration › System preferences > OPAC, set PatronSelfRegistration to
'don't allow'

2.) Modify the unwanted fields for PatronSelfModificationBorrowerUnwantedField
and PatronSelfRegistrationBorrowerUnwantedField so that at least one field is
different between the two settings and save (for example, specify 'mobile' to be
hidden in the former, but don't include in the list of fields to be hidden in
the latter).

3.) Log into the OPAC and navigate to the 'your personal details' tab. Notice
that the editable fields correspond to those not hidden by
PatronSelfModificationBorrowerUnwantedField

4.) Without making any changes, click on 'Submit update request'.

5.) Note that on this page the fields correspond to those not hidden by
PatronSelfRegistrationBorrowerUnwantedField and are now editable (including any
fields that would otherwise be hidden by the Self Modification settings).

Reported-By: Chris Slone <cslone@camdencountylibrary.org>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Nick Clemens 2019-01-18 20:57:52 UTC
Awesome work all!

Pushed to master for 19.05
Comment 9 Martin Renvoize 2019-01-31 16:13:10 UTC
Pushed to 18.11.x for 18.11.03
Comment 10 Lucas Gass 2019-02-01 17:12:54 UTC
pushed to 18.05.x for 18.05.09
Comment 11 Fridolin Somers 2019-02-04 09:33:51 UTC
Pushed to 17.11.x for 17.11.15