Koha is built to prevent sending duplicate notices. Notices with static language ( e.g. "You have one or more holds ready to pick up" ) will easily trigger this filter. RestrictPatronsWithFailedNotices should ignore these notices because they do not indicate any problem with contacting the patron.
Created attachment 181530 [details] [review] Bug 39749: RestrictPatronsWithFailedNotices should not trigger for DUPLICATE_MESSAGE failures Koha is built to prevent sending duplicate notices. Notices with static language ( e.g. "You have one or more holds ready to pick up" ) will easily trigger this filter. RestrictPatronsWithFailedNotices should ignore these notices because they do not indicate any problem with contacting the patron. Test Plan: 1) Enable RestrictPatronsWithFailedNotices 2) Enqueue to identical notices for a patron 3) Run process message queue to send one and fail the other as a duplicate ( alternately, just modify them in the database ) 4) Run restrict_patrons_with_failed_notices.pl 5) Note the restriction 6) Remove the restriction 7) Apply this patch 8) Run restrict_patrons_with_failed_notices.pl 9) Note that no restriction was created!
# Test Result Could not reproduce issue. # Test Execution 1. Set "RestrictPatronsWithFailedNotices" to "Apply." 2. Enqueued 2 identical notices to a patron: - Subject: KOHA - Notice - Body: You have one or more holds ready to pick up 3. Ran `./misc/cronjobs/process_message_queue.pl`. 4. Both notices were sent successfully. 5. Manually update the DB: UPDATE message_queue SET status='failed' WHERE message_id=2; 6. Ran `./misc/cronjobs/restrict_patrons_with_failed_notices.pl`. 7. Patron does not have any restrictions.
I am still able to reproduce the issue. I'm attaching a pre-configured KTD database where Henry Acevedo will be restricted. To test just load the backup into KTD and run ./misc/cronjobs/restrict_patrons_with_failed_notices.pl -v -c
Created attachment 182597 [details] Preconfigured KTD Database for testing I've deleted all biblio records to shrink the file size.