Bug 39883 - NEW_SUGGESTION email notices end up in the patrons notice tab (members/notices.pl) when they should not
Summary: NEW_SUGGESTION email notices end up in the patrons notice tab (members/notice...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Pedro Amorim
URL:
Keywords: additional_work_needed
Depends on:
Blocks:
 
Reported: 2025-05-12 20:53 UTC by Lucas Gass (lukeg)
Modified: 2025-08-15 15:53 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
The patch makes it so NEW_SUGGESTION email notices do not show up in a patron's notice history.
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices (1.84 KB, patch)
2025-05-12 21:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices (1.89 KB, patch)
2025-05-13 16:22 UTC, Lin Wei
Details | Diff | Splinter Review
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices (1.95 KB, patch)
2025-08-05 15:35 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39883: ( follow-up ) Adjust tests to not rely on borrowernumber (7.33 KB, patch)
2025-08-15 15:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 39883: (follow-up) Retrieve messages by letter_code (2.61 KB, patch)
2025-08-15 15:46 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2025-05-12 20:53:50 UTC
To recreate:

1. Turn on EmailPurchaseSuggestions and add an email address to EmailAddressForSuggestions.
2. Create a new suggestion and set the "
Created by:" field to a patron with an email address
3. Check the message queue ( select * from message_queue where letter_code = "NEW_SUGGESTION" )
4. There is a NEW_SUGGESTION queued, the to_address should be the email you entered in EmailAddressForSuggestions.
5. The borrowernumber is the borrower who made the suggestion.

This shouldn't end up in the notice tab for the borrower since these notices are for staff.
Comment 1 Lucas Gass (lukeg) 2025-05-12 21:56:21 UTC
Created attachment 182315 [details] [review]
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices

1. Turn on EmailPurchaseSuggestions and add an email address to EmailAddressForSuggestions.
2. Create a new suggestion and set the "
Created by:" field to a patron with an email address
3. Check the message queue ( select * from message_queue where letter_code = "NEW_SUGGESTION" )
4. There is a NEW_SUGGESTION queued, the to_address should be the email you entered in EmailAddressForSuggestions.
5. The borrowernumber is the borrower who made the suggestion.
6. APPLY PATCH, restart_all
7. Repeat steps 2 - 4.
8. This time a NEW_SUGGESTION should be queued, but the borrowernumber will be undef
9. Check in the patron's notice tab, there should be nothing queued.
Comment 2 Lin Wei 2025-05-13 16:22:48 UTC
Created attachment 182391 [details] [review]
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices

1. Turn on EmailPurchaseSuggestions and add an email address to EmailAddressForSuggestions.
2. Create a new suggestion and set the "
Created by:" field to a patron with an email address
3. Check the message queue ( select * from message_queue where letter_code = "NEW_SUGGESTION" )
4. There is a NEW_SUGGESTION queued, the to_address should be the email you entered in EmailAddressForSuggestions.
5. The borrowernumber is the borrower who made the suggestion.
6. APPLY PATCH, restart_all
7. Repeat steps 2 - 4.
8. This time a NEW_SUGGESTION should be queued, but the borrowernumber will be undef
9. Check in the patron's notice tab, there should be nothing queued.

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Comment 3 Pedro Amorim 2025-08-05 15:35:09 UTC
Created attachment 185133 [details] [review]
Bug 39883: Do not pass the borrowernumber for NEW_SUGGESTION notices

1. Turn on EmailPurchaseSuggestions and add an email address to EmailAddressForSuggestions.
2. Create a new suggestion and set the "
Created by:" field to a patron with an email address
3. Check the message queue ( select * from message_queue where letter_code = "NEW_SUGGESTION" )
4. There is a NEW_SUGGESTION queued, the to_address should be the email you entered in EmailAddressForSuggestions.
5. The borrowernumber is the borrower who made the suggestion.
6. APPLY PATCH, restart_all
7. Repeat steps 2 - 4.
8. This time a NEW_SUGGESTION should be queued, but the borrowernumber will be undef
9. Check in the patron's notice tab, there should be nothing queued.

Signed-off-by: Lin Wei Li <lin-wei.li@inLibro.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 4 Lucas Gass (lukeg) 2025-08-14 22:09:08 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Lucas Gass (lukeg) 2025-08-15 15:15:23 UTC
Created attachment 185467 [details] [review]
Bug 39883: ( follow-up ) Adjust tests to not rely on borrowernumber
Comment 6 Lucas Gass (lukeg) 2025-08-15 15:44:56 UTC
Actually, a better way to get the data I want is to replace the search by borrowernumber with letter_code => 'NEW_SUGGESTION
Comment 7 Lucas Gass (lukeg) 2025-08-15 15:46:43 UTC
Created attachment 185471 [details] [review]
Bug 39883: (follow-up) Retrieve messages by letter_code
Comment 8 Lucas Gass (lukeg) 2025-08-15 15:53:06 UTC
follow-up pushed to main