Bug 26973 - extendedPatronAttributes not showing during selfregistration
Summary: extendedPatronAttributes not showing during selfregistration
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: PC Linux
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 27020 (view as bug list)
Depends on: 26119
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-09 12:16 UTC by JanMueck
Modified: 2023-10-03 01:57 UTC (History)
8 users (show)

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


Attachments
screenshots and irc chat (435.55 KB, application/pdf)
2020-11-09 12:16 UTC, JanMueck
Details
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration (3.27 KB, patch)
2020-11-10 11:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration (3.34 KB, patch)
2020-11-11 09:32 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration (3.40 KB, patch)
2020-11-16 13:30 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26973: [20.05.x] (bug 26119 follow-up) Restore patron's attributes during self-registration (3.30 KB, patch)
2020-11-17 15:17 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 JanMueck 2020-11-09 12:16:27 UTC
Created attachment 113307 [details]
screenshots and irc chat

In the Koha Version 20.05.04 the extendedPatronAttributes not showing during selfregistration.
I created a PatronAttribute "Matrikelnummer" which is configured to be shown and editable in OPAC. It also is searchable. The attribut is set for all user and bibtypes.

PatronSelfRegistrationVerifyByEmail is disabled
extendedPatronAttributes is enabled

I tested the same configuration on another server with koha version 20.05.01. The field "Matrikelnummer" is shown during the selfregistration process and the entered values are set correctly in the mysql database and userdetails.
Comment 1 Jonathan Druart 2020-11-10 11:58:15 UTC
Created attachment 113366 [details] [review]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)
Comment 2 Sally 2020-11-10 12:41:45 UTC
With PatronSelfRegistrationVerifyByEmail set to 'Don't Require':

- Can set the patron attributes on the self-registration form
- Can edit the patron attributes in 'your personal details'
- If the patron attribute is set to display but not edit, you can view it but not change it
- If the patron attribute is set to display but not edit, it correctly doesn't show on the self-registration form

The only issue I can see is that all Additional attributes and identifiers are submitted, even if they're not changed.  To replicate:

- Set one or two patron attributes to editable in the OPAC
- Log in as a patron on the OPAC
- Go to 'your personal details' - opac-memberentry.pl
- Change the salutation and do not modify anything else
- Submit
- Go to the staff client
- View 'Patrons requesting modifications' - members/members-update.pl
- Note that the changed salutation field is included, but so are the patron attribute fields, despite no edits being made to the Additional attributes and identifiers

With PatronSelfRegistrationVerifyByEmail set to 'Require':

- The patron attributes are not visible on the self-registration form
- Existing users can edit the patron attributes in 'your personal details'
- If the patron attribute is set to display but not edit, you can view it but not change it

However, trying to sign up a new account gives an error - not sure if this is a sandbox configuration issue - but the error is:  Invalid 'from' parameter: root@localhost at /usr/share/perl5/Exception/Class/Base.pm line 88
Comment 3 Jonathan Druart 2020-11-10 13:20:56 UTC
Thanks for testing, Sally!

(In reply to Sally from comment #2)
> The only issue I can see is that all Additional attributes and identifiers
> are submitted, even if they're not changed.  To replicate:
> 
> - Set one or two patron attributes to editable in the OPAC
> - Log in as a patron on the OPAC
> - Go to 'your personal details' - opac-memberentry.pl
> - Change the salutation and do not modify anything else
> - Submit
> - Go to the staff client
> - View 'Patrons requesting modifications' - members/members-update.pl
> - Note that the changed salutation field is included, but so are the patron
> attribute fields, despite no edits being made to the Additional attributes
> and identifiers

But then this problem exists without this patch as well, right?

> However, trying to sign up a new account gives an error - not sure if this
> is a sandbox configuration issue - but the error is:  Invalid 'from'
> parameter: root@localhost at /usr/share/perl5/Exception/Class/Base.pm line 88

Yes, it's because the syspref KohaAdminEmailAddress is set to an invalid email address (root@localhost), you can try with "test@example.org".
Comment 4 ByWater Sandboxes 2020-11-11 09:32:20 UTC
Created attachment 113462 [details] [review]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 5 Sally 2020-11-11 09:35:18 UTC
> But then this problem exists without this patch as well, right?

Ah, so it does - sorry, I don't know how I missed that (doing too much at once again).  

> Yes, it's because the syspref KohaAdminEmailAddress is set to an invalid
> email address (root@localhost), you can try with "test@example.org".

Thank you!

I've signed the patch off.  :)
Comment 6 Jonathan Druart 2020-11-14 08:17:44 UTC
*** Bug 27020 has been marked as a duplicate of this bug. ***
Comment 7 Martin Renvoize (ashimema) 2020-11-16 13:30:06 UTC
Created attachment 113663 [details] [review]
Bug 26973: (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2020-11-16 13:30:29 UTC
Works as expected, no regressions found.

Passing QA
Comment 9 Jonathan Druart 2020-11-17 11:26:18 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Lucas Gass (lukeg) 2020-11-17 14:54:20 UTC
this patchset does not apply cleanly to 20.05.x, but it is needed.
Comment 11 Jonathan Druart 2020-11-17 15:17:14 UTC
Created attachment 113737 [details] [review]
Bug 26973: [20.05.x] (bug 26119 follow-up) Restore patron's attributes during self-registration

The assumption on bug 26119 was wrong. We actually store patron's
attributes during self-registration if
PatronSelfRegistrationVerifyByEmail is not enabled.

Test plan:
Test the different combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
Confirm that the patron's attributes appears during self-registration if
PatronSelfRegistrationVerifyByEmail is not set.
Confirm that the patron's attributes are stored when they are displayed
on the self-registration form
Confirm that you can edit the patron's attributes in any cases (if they
are marked as editable at the OPAC)
Comment 12 Lucas Gass (lukeg) 2020-11-17 15:49:14 UTC
Thanks Jonathan,

backported to 20.05.x for 20.05.06
Comment 13 Aleisha Amohia 2020-11-17 20:26:50 UTC
backported to 19.11.x for 19.11.12
Comment 14 Victor Grousset/tuxayo 2020-11-18 11:54:03 UTC
Missing dependencies for 19.05.x so bug shouldn't affect it. No backporting.
Comment 15 David Cook 2023-10-03 01:45:05 UTC
I find it a bit weird that patron attributes aren't shown when PatronSelfRegistrationVerifyByEmail is enabled.

Surely most Koha instances should have PatronSelfRegistrationVerifyByEmail enabled...

I suppose that's more of an enhancement though...
Comment 16 David Cook 2023-10-03 01:50:27 UTC
(In reply to David Cook from comment #15)
> I find it a bit weird that patron attributes aren't shown when
> PatronSelfRegistrationVerifyByEmail is enabled.
> 
> Surely most Koha instances should have PatronSelfRegistrationVerifyByEmail
> enabled...
> 
> I suppose that's more of an enhancement though...

Although it looks like borrower_modifications can support extended_attributes...
Comment 17 David Cook 2023-10-03 01:57:12 UTC
Ah hence bug 30120. Never mind...