Bug 37339 - Default messaging preferences are not applied when self registering in OPAC
Summary: Default messaging preferences are not applied when self registering in OPAC
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 23.05
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 30318
Blocks:
  Show dependency treegraph
 
Reported: 2024-07-12 08:30 UTC by Andreas Jonsson
Modified: 2024-10-21 13:35 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes a regression in Koha 24.05, 23.11, and 23.05 (caused by Bug 30318). Default messaging preferences for the self registraton patron category were not set for patron's self-registering using the OPAC.
Version(s) released in:
24.11.00,24.05.05,23.11.10
Circulation function:


Attachments
Bug 37339: Set messaging preferences from default on self registration (4.66 KB, patch)
2024-07-12 15:29 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37339: Set messaging preferences from default on self registration (4.70 KB, patch)
2024-07-12 20:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 37339: Set messaging preferences from default on self registration (4.77 KB, patch)
2024-07-17 16:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jonsson 2024-07-12 08:30:30 UTC
The default messaging preferences are no longer applied when self registering in OPAC.

This seems be a regression caused by bug 30318.

Implementing bug 34003 is a possible solution.

Another possible solution is to render the default messaging preferences as hidden fields in the self registration form.

A third alternative is to called C4::Members::Messaging::SetMessagingPreferencesFromDefaults at an opportune moment.
Comment 1 Nick Clemens (kidclamp) 2024-07-12 15:29:15 UTC
Created attachment 168920 [details] [review]
Bug 37339: Set messaging preferences from default on self registration

The change on bug 30318 prevented setting the default messaging preferences when none were passed.
Self registration relied on this for setting borrower preferences from the defaults.

This patch removes the call to handle_form_action and replaces it with a call to:
SetMessagingPreferencesFromDefault

To test:
 1 - Ensure self registration is enabled
 2 - Set default messaging preferences for the self registration category
 3 - Self register a patron from the OPAC, confirm defaults not set
 4 - Apply patch, restart all
 5 - Self register a patron
 6 - Confirm defaults have been set
 7 - Enable  PatronSelfRegistrationVerifyByEmail
 8 - Self register a patron on OPAC with an email
 9 - Find the email and grab the verification link (unless you have emails enabled)
     SELECT * FROM message_queue;
10 - Visit the link and confirm registration
11 - Confirm messaging defaults are set
Comment 2 David Nind 2024-07-12 20:35:14 UTC
Created attachment 168924 [details] [review]
Bug 37339: Set messaging preferences from default on self registration

The change on bug 30318 prevented setting the default messaging preferences when none were passed.
Self registration relied on this for setting borrower preferences from the defaults.

This patch removes the call to handle_form_action and replaces it with a call to:
SetMessagingPreferencesFromDefault

To test:
 1 - Ensure self registration is enabled
 2 - Set default messaging preferences for the self registration category
 3 - Self register a patron from the OPAC, confirm defaults not set
 4 - Apply patch, restart all
 5 - Self register a patron
 6 - Confirm defaults have been set
 7 - Enable  PatronSelfRegistrationVerifyByEmail
 8 - Self register a patron on OPAC with an email
 9 - Find the email and grab the verification link (unless you have emails enabled)
     SELECT * FROM message_queue;
10 - Visit the link and confirm registration
11 - Confirm messaging defaults are set

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize (ashimema) 2024-07-17 16:03:32 UTC
Created attachment 169098 [details] [review]
Bug 37339: Set messaging preferences from default on self registration

The change on bug 30318 prevented setting the default messaging preferences when none were passed.
Self registration relied on this for setting borrower preferences from the defaults.

This patch removes the call to handle_form_action and replaces it with a call to:
SetMessagingPreferencesFromDefault

To test:
 1 - Ensure self registration is enabled
 2 - Set default messaging preferences for the self registration category
 3 - Self register a patron from the OPAC, confirm defaults not set
 4 - Apply patch, restart all
 5 - Self register a patron
 6 - Confirm defaults have been set
 7 - Enable  PatronSelfRegistrationVerifyByEmail
 8 - Self register a patron on OPAC with an email
 9 - Find the email and grab the verification link (unless you have emails enabled)
     SELECT * FROM message_queue;
10 - Visit the link and confirm registration
11 - Confirm messaging defaults are set

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-07-17 16:03:56 UTC
All makes sense, no QA issues, no regressions.

Passing QA
Comment 5 Katrin Fischer 2024-07-18 14:31:31 UTC
Just wondering:

If we have:
+                C4::Members::Messaging::SetMessagingPreferencesFromDefaults

Do we still need the use?

+use C4::Members::Messaging qw( SetMessagingPreferencesFromDefaults );
Comment 6 Katrin Fischer 2024-07-18 15:57:33 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass (lukeg) 2024-10-09 22:01:41 UTC
Backported to 24.05.x for upcoming 24.05.05
Comment 8 Fridolin Somers 2024-10-21 13:35:39 UTC
Pushed to 23.11.x for 23.11.10