Bug 33192 - We should rename 'AutoEmailPrimaryAddress' to 'EmailFieldPrimary' for clarification
Summary: We should rename 'AutoEmailPrimaryAddress' to 'EmailFieldPrimary' for clarifi...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Katrin Fischer
URL:
Keywords: Academy
Depends on:
Blocks: 29046 33191 33223
  Show dependency treegraph
 
Reported: 2023-03-10 10:58 UTC by Martin Renvoize
Modified: 2023-06-09 10:47 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/687
Text to go in the release notes:
The enhancement renames AutoEmailPrimaryAddress the system preference to EmailFieldPrimary to reflect the fact that it is not only used in the context of AutoEmailNewUser, but in general for email notices.
Version(s) released in:
23.05.00


Attachments
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary (3.54 KB, patch)
2023-03-13 14:06 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress (5.11 KB, patch)
2023-03-13 14:06 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary (3.61 KB, patch)
2023-03-13 19:16 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress (5.18 KB, patch)
2023-03-13 19:16 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary (3.67 KB, patch)
2023-04-10 14:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress (7.00 KB, patch)
2023-04-10 14:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33192: Fix it-IT sample data and unit tests (2.95 KB, patch)
2023-04-10 14:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 33192: (QA follow-up) Fix it-IT sample data and unit tests (2.96 KB, patch)
2023-04-10 14:44 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 Martin Renvoize 2023-03-10 10:58:36 UTC
The AutoEmailPrimaryAddress preference no longer only affects AutoEmailNewUser (formerly known as AutoEmailOpacUser).

As such I feel it should be clarified and renamed to EmailFieldPrimary to show it is actually being used for the majority of notices now.

I chose EmailField* to sit it next to the new preference I attempt to introduce in bug 29046.
Comment 1 Caroline Cyr La Rose 2023-03-10 21:56:27 UTC
Martin,

Can you specify what it affects exactly? I'll make a note to add this in the manual...

Caroline
Comment 2 Martin Renvoize 2023-03-13 13:24:43 UTC
The preferece is used in only one routine, Koha::Patron->notice_email_address.  But it appears at some point, this method pretty much supplanted Koha::Patron->first_valid_email_address and is used in a lot more of the codebase.

notice_email_address is used in:

C4::Auth_With_shibboleth
C4::Letters (as the default)
C4::Auth - For 2FA
C4::Auth_with_ldap
C4::Reserves
shareshelf.pl
memberentry.pl
opac-registration-varify.pl
two_factor_auth.pl
notice.pl
memberentry.pl
pendingreserves.pl
Koha::Ticket
Patron::Import.pm
suggestion.pl
overdue_notices.pl
TalkingTech_iteive_outbound.pl
notice_unprocessed_suggestions.pm

first_valid_email is now only used in:

clubs-tab.tt
waiting_holds.inc
transferstoreceive.tt
opac-sendbasket.pl
Koha::SharedContent

And there's likely a few other cases where we refer more directly to the email fields rather than using the methods.
Comment 3 Martin Renvoize 2023-03-13 14:06:38 UTC
Created attachment 148118 [details] [review]
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary

This patch updates the database to reflect the new name for the
AutoEmailPrimaryAddress system preferences
Comment 4 Martin Renvoize 2023-03-13 14:06:40 UTC
Created attachment 148119 [details] [review]
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress

This patch updates all references to AutoEmailPrimaryAddress to refer to
EmailFieldPrimary instead.
Comment 5 Caroline Cyr La Rose 2023-03-13 19:15:08 UTC
1. Add primary, secondary and alternate email addresses in a patron's account
   - Primary email = primary@...
   - Secondary email = secondary@...
   - Email, under Alternate address = alternate@...

2. Set EmailFieldPrimary to home (primary email)

3. In the patron's account click More > Send welcome email

4. Check the message_queue, the to_address should be primary@...

select to_address, message_transport_type, letter_code, time_queued from message_queue where date(time_queued) = curdate();

5. Set EmailFieldPrimary to work (secondary email)

6. Repeat steps 3 and 4, the to_address should be secondary@...

7. Set EmailFieldPrimary to alternate

8. Repeat steps 3 and 4, the to_address should be alternate@...

9. Set EmailFieldPrimary to cardnumber as

10. Repeat steps 3 and 4, the to_address should be the patron's cardnumber

11. Set EmailFieldPrimary to first valid

12. Repeat steps 3 and 4, the to_address should be primary@...

13. Remove the primary email from the patron's account

14. Repeat steps 3 and 4, the to_address should be secondary@...

15. Remove the secondary email from the patron's account

16. Repeat steps 3 and 4, the to_address should be alternate@...

If there are no email addresses at all, the notice is not generated.
Comment 6 Caroline Cyr La Rose 2023-03-13 19:16:42 UTC
Created attachment 148139 [details] [review]
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary

This patch updates the database to reflect the new name for the
AutoEmailPrimaryAddress system preferences

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 7 Caroline Cyr La Rose 2023-03-13 19:16:45 UTC
Created attachment 148140 [details] [review]
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress

This patch updates all references to AutoEmailPrimaryAddress to refer to
EmailFieldPrimary instead.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 8 Jonathan Druart 2023-03-22 15:50:25 UTC
Shouldn't it be EmailAddress instead of Email? It's not a verb, and we have AutoEmailOpacUser where it is used as a verb.
Comment 9 Katrin Fischer 2023-04-10 14:43:15 UTC
Created attachment 149381 [details] [review]
Bug 33192: Update AutoEmailPrimaryAddress to EmailFieldPrimary

This patch updates the database to reflect the new name for the
AutoEmailPrimaryAddress system preferences

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2023-04-10 14:43:18 UTC
Created attachment 149382 [details] [review]
Bug 33192: Update all occurrences of AutoEmailPrimaryAddress

This patch updates all references to AutoEmailPrimaryAddress to refer to
EmailFieldPrimary instead.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2023-04-10 14:43:21 UTC
Created attachment 149383 [details] [review]
Bug 33192: Fix it-IT sample data and unit tests

To test:
* prove t/db_dependent/Message.t
* Run the it-IT web installer and make sure 'email' is set.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2023-04-10 14:44:03 UTC
Created attachment 149384 [details] [review]
Bug 33192: (QA follow-up) Fix it-IT sample data and unit tests

To test:
* prove t/db_dependent/Message.t
* Run the it-IT web installer and make sure 'email' is set.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Jonathan Druart 2023-04-13 09:09:11 UTC
Should not we add the original name in the description, so that the search will return the new one when then old one is searched for?
Comment 14 Katrin Fischer 2023-04-13 10:04:47 UTC
(In reply to Jonathan Druart from comment #13)
> Should not we add the original name in the description, so that the search
> will return the new one when then old one is searched for?

Formerly known as... ? :)

I am not sure to be honest. I hesitate as that will mean that we will probably never get rid of it and we might end up with a lot of those entries over time.
Comment 15 Caroline Cyr La Rose 2023-04-13 13:18:37 UTC
AFAIK, there is no precedent for this...
gist -> TaxRates, gist is not mentioned in the description
NotesBlacklist -> NotesToHide, no mention
RequestOnOpac -> OPACHoldRequests, no mention

etc.
Comment 16 Tomás Cohen Arazi 2023-04-14 14:36:16 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 17 Matt Blenkinsop 2023-04-18 12:15:25 UTC
Enhancement - not backporting to 22.11.x

Nice work everyone!