[Bug 23295] New: Automatically debar patrons if SMS or email notice fail
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Bug ID: 23295 Summary: Automatically debar patrons if SMS or email notice fail Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org When the sending of an SMS (or email) notice fails at the Koha level (i.e. before it is passed to the SMS API) then librarians should have the ability to enable automatic restriction (debarment) of patrons prompting them to update their smsalertnumber (or email address) in their library accounts. Adding this ability will tie in nicely with the functionality implemented in bug 13552 and bug 23291. As the enhancement for this bug report would let us restrict when notices failed at the Koha level, whereas 13552 and 23291 would let librarians restrict when notices failed at the SMS API level in batch restriction jobs retrieving patrons by SMS numbers in the SMS gateway report libraries get telling them which notices failed at the SMS API level. So all three enhancements together will mean there will be end-to-end functionality to restrict patrons when SMS notices fail, thereby prompting them to update their smsalertnumber. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |hayleymapley@catalyst.net.n | |z Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |alexbuckley@catalyst.net.nz |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #1 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 91471 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91471&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-By: Brimbank Library, Australia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hagud@orex.es Status|Needs Signoff |Patch doesn't apply --- Comment #2 from Hugo Agud <hagud@orex.es> --- warning: 3 lines applied after fixing whitespace errors. Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Auto-merging installer/data/mysql/sysprefs.sql Auto-merging C4/Letters.pm CONFLICT (content): Merge conflict in C4/Letters.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-23295-Automatically-restrict-debar-patrons-whe-6bIBRK.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #91471|0 |1 is obsolete| | --- Comment #3 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 102068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102068&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-By: Brimbank Library, Australia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz Status|Patch doesn't apply |ASSIGNED Assignee|alexbuckley@catalyst.net.nz |aleisha@catalyst.net.nz --- Comment #4 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Rebased, however tests fail: $ prove -v t/db_dependent/Koha/Notices.t t/db_dependent/Koha/Notices.t .. 1..8 ok 1 - The template should have been added ok 2 - Find a notice template by pk should return the correct template ok 3 - Delete should have deleted the template ok 4 - No failed notices currently exist not ok 5 - One failed notice currently exists # Failed test 'One failed notice currently exists' # at t/db_dependent/Koha/Notices.t line 98. # got: '0' # expected: '1' ok 6 - No failed notices currently existing, now the notice has been marked pending not ok 7 - Patron has a restriction placed on them # Failed test 'Patron has a restriction placed on them' # at t/db_dependent/Koha/Notices.t line 129. # got: '0' # expected: '1' not ok 8 - No new restriction has been placed on the patron # Failed test 'No new restriction has been placed on the patron' # at t/db_dependent/Koha/Notices.t line 150. # got: '0' # expected: '1' # Looks like you failed 3 tests of 8. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/8 subtests Test Summary Report ------------------- t/db_dependent/Koha/Notices.t (Wstat: 768 Tests: 8 Failed: 3) Failed tests: 5, 7-8 Non-zero exit status: 3 Files=1, Tests=8, 1 wallclock secs ( 0.02 usr 0.00 sys + 1.08 cusr 0.11 csys = 1.21 CPU) Result: FAIL ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102068|0 |1 is obsolete| | --- Comment #5 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 102098 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102098&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-By: Brimbank Library, Australia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |bgkriegel@gmail.com --- Comment #6 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Hi, patch does not apply, an easy conflict in patrons.pref Solving that, qa tools little complain FAIL misc/cronjobs/restrict_patrons_with_failed_notices.pl FAIL critic "$type" is declared but not used at line 16, column 1. Unused variables clutter code and make it harder to read. OK forbidden patterns OK git manipulation OK pod OK spelling OK valid That new file also lacks a copyright notice! Running that file always generates some output. It has a verbose option, but not a quiet/silent one. As a cron job it will always send an email with the output, unless you redirects out to /dev/null. Why not print something only with '-v' and be silent otherwise (unless there's some error)? Not fully tested yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102098|0 |1 is obsolete| | --- Comment #7 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 105003 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105003&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-By: Brimbank Library, Australia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #8 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Bernardo Gonzalez Kriegel from comment #6)
Hi, patch does not apply, an easy conflict in patrons.pref
Solving that, qa tools little complain
FAIL misc/cronjobs/restrict_patrons_with_failed_notices.pl FAIL critic "$type" is declared but not used at line 16, column 1. Unused variables clutter code and make it harder to read. OK forbidden patterns OK git manipulation OK pod OK spelling OK valid
That new file also lacks a copyright notice!
Running that file always generates some output. It has a verbose option, but not a quiet/silent one. As a cron job it will always send an email with the output, unless you redirects out to /dev/null. Why not print something only with '-v' and be silent otherwise (unless there's some error)?
Not fully tested yet.
Have fixed conflict, removed unused variable, added copyright notice, and amended the cron to default to no output unless the verbose option is specified. Ready for testing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Nice work. I just wonder about get_failed_notices() method in Koha/Notice/Message.pm. It does not use current object. And why using SQL and not the ORM ? Also : Koha::Notice::Message::restrict_patron_when_notice_fails($failed_notice); This is strange. Method restrict_patron_when_notice_fails() should be called on a Koha::Notice::Message object instance. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #10 from Aleisha Amohia <aleisha@catalyst.net.nz> --- I'll work on that ^ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #105003|0 |1 is obsolete| | --- Comment #11 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 116181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116181&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-By: Brimbank Library, Australia -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116181|0 |1 is obsolete| | --- Comment #12 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 158687 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158687&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31095 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31095 [Bug 31095] Remove Koha::Patron::Debarment::GetDebarments and use $patron->restrictions in preference -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Matthias Le Gac <matthias.le-gac@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |matthias.le-gac@inlibro.com --- Comment #13 from Matthias Le Gac <matthias.le-gac@inlibro.com> --- When I applied the patch it doesnt't work. I have this error : Applying: Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail Using index info to reconstruct a base tree... M Koha/Notice/Message.pm M installer/data/mysql/mandatory/sysprefs.sql M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Auto-merging installer/data/mysql/mandatory/sysprefs.sql Auto-merging Koha/Notice/Message.pm CONFLICT (content): Merge conflict in Koha/Notice/Message.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158687|0 |1 is obsolete| | --- Comment #14 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 160785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160785&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #15 from Lucas Gass <lucas@bywatersolutions.com> --- Aleisha, There is a YAML problem with patrons.pref, I believe. With this patchset applied when I do a seach for system preferences I get: YAML::XS::Load Error: The problem: did not find expected key was found at document: 1, line: 391, column: 5 while parsing a block mapping at line: 2, column: 5 at /kohadevbox/koha/admin/preferences.pl line 51 in CGI::Compile::ROOT::kohadevbox_koha_admin_preferences_2epl::GetTab at /kohadevbox/koha/admin/preferences.pl line 51 Also, ,maybe perltidy "restrict_patrons_with_failed_notices.pl" ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160785|0 |1 is obsolete| | --- Comment #16 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 160890 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160890&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |no-sandbox -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |david@davidnind.com --- Comment #17 from David Nind <david@davidnind.com> --- The patch no longer applies 8-(.... git bz apply 23295 Bug 23295 - Automatically debar patrons if SMS or email notice fail 160890 - Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail Using index info to reconstruct a base tree... M Koha/Notice/Message.pm M installer/data/mysql/mandatory/sysprefs.sql M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref .git/rebase-apply/patch:130: new blank line at EOF. + warning: 1 line adds whitespace errors. Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref Auto-merging installer/data/mysql/mandatory/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql Auto-merging Koha/Notice/Message.pm CONFLICT (content): Merge conflict in Koha/Notice/Message.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160890|0 |1 is obsolete| | --- Comment #18 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 167599 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167599&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167599|0 |1 is obsolete| | --- Comment #19 from David Nind <david@davidnind.com> --- Created attachment 167778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167778&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #20 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Before step 1 (so can tick the SMS option for triggers and add an SMS notice of ODUE): Do test plan step 2. 2. I checked out items to Mary and Henry (I changed Henry's patron category to Patron). 3. Step 4 - format for date: . UPDATE issues SET date_due='2024-06-14 23:59:00' WHERE borrowernumber=49; 4. Steps 5 and 6 - in KTD from ktd--shell run: misc/cronjobs/overdue_notices.pl 5. Steps 15 + 16 - run with -v to see the message: ./restrict_patrons_with_failed_notices.pl -v There are borrowers with failed SMS or email notices 6. Output from step 18: ./restrict_patrons_with_failed_notices.pl -v -c There are borrowers with failed SMS or email notices Applying restriction to patron 49: Mary Burton Applying restriction to patron 19: Henry Acevedo -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |kyle@bywatersolutions.com --- Comment #21 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- I think it makes sense to add a new row to restriction_types for this type of restriction. This will also make the messages translatable! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED --- Comment #22 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Kyle M Hall (khall) from comment #21)
I think it makes sense to add a new row to restriction_types for this type of restriction. This will also make the messages translatable!
Thanks for your review Kyle and your testing David! I am adding to our atomicupdate to add a new SUSPENSION row to the restriction_types table! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #23 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 172507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172507&action=edit Bug 23295: (follow-up) Add 'NOTICE_FAILURE_SUSPENSION' as a new system restriction type Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #24 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Alex Buckley from comment #22)
(In reply to Kyle M Hall (khall) from comment #21)
I think it makes sense to add a new row to restriction_types for this type of restriction. This will also make the messages translatable!
Thanks for your review Kyle and your testing David!
I am adding to our atomicupdate to add a new SUSPENSION row to the restriction_types table!
Hi Kyle, I've attached a follow-up adding a new 'NOTICE_FAILURE_SUSPENSION' system restriction type and assigning that to users whose email or SMS notices fail. Could you please confirm what I have added is what you had in mind? If not I will follow-up again. Thanks, Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #25 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- This looks good! Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167778|0 |1 is obsolete| | Attachment #172507|0 |1 is obsolete| | --- Comment #26 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172538 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172538&action=edit Bug 23295: Automatically restrict (debar) patrons when email/sms notices fail When the 'RestrictPatronsWithFailedNotices' syspref is enabled then patrons with email and sms notices which failed sending (have a message_queue.status field of 'failed') have a restriction (debarment) applied to them. Test plan: 1. In the Koha staff client > Tools > Overdue notice/status triggers and create the 'First' rule for all patron categories as: Delay: 1 Letter: Overdue Notice SMS: ticked Ensure you have an SMS notice for the ODUE letter. 2. In the system preferences make sure you enter dummy data into the SMSSendUsername, SMSSendPassword and EmailSMSSendDriverFromAddress sysprefs 2. Find two non-debarred patrons and make sure they have invalid SMS numbers set. The SMS numbers must be INCORRECT, for example "123" as an SMS number. Leaving this field empty will result in the message_transport_type defaulting to 'print' instead of 'sms'. 3. Check one item out to each patron in step 2 4. Jump into the database and run the query: UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower1>; UPDATE issues SET date_due=<2 days before current date> WHERE borrowernumber=<borrower2>; 5. Go to misc/cronjobs directory and enter the Koha shell: sudo koha-shell <instancename> 6. Run: ./overdue_notices.pl 7. Exit the shell and jump back into the database and run the query: SELECT message_transport_type, status FROM message_queue WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 8. Confirm both new notice records have the message_transport_type is 'sms' and the status of 'pending' 9. Exit the database and re-enter the Koha shell and run the command: ./process_message_queue.pl 10. Jump back into the database re-run the query from step 7 and confirm the status is 'failed' for both 11. Also run the query: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice there is no added debarment to these two patrons 12. Apply patch, restart memcached and plack. In the installer/data/mysql directory enter the Koha shell and run the command: ./update_database.pl 13. In the Administration > Global System Preferences interface of the staff client notice there is a new system (set to "Don't" by default) named 'RestrictPatronsWithFailedNotices'. Enable it (i.e. select 'Do') 14. Create a new file in the /etc/cron.daily directory named koha-custom and add the following line to it: koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/restrict_patrons_with_failed_notices.pl 15. In the misc/cronjobs directory enter the Koha shell and run the command: ./restrict_patrons_with_failed_notices.pl 16. The script should output text saying: There are borrowers with failed SMS or email notices However because you haven't given the script the argument -c it won't apply debarments (restrictions) to any of the patrons with the failed SMS or email notices. 16. Query the borrower_debarments table: SELECT * FROM borrower_debarments WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; Notice they still have no restriction 17. Now in the Koha shell run the command: ./restrict_patrons_with_failed_notices.pl -c 18. Notice the script outputs the text: There are borrowers with failed SMS or email notices Applying restriction to patron <borrowernumber>: <borrower firstname> <borrower surname>; 19. Repeat step 16 and notice both patrons now have 1 restriction each with the borrower_debarments.type=SUSPENSION and comment=SMSnumber invalid and expiration=NULL 20. Query the borrowers table: SELECT debarred, debarredcomment FROM borrowers WHERE borrowernumber=<borrower1> OR borrowernumber=<borrower2>; 21. Notice the values are: debarred= 9999-12-31 debarredcomment= SMS number invalid 22. Repeat step 17 and notice the script outputs: There are borrowers with failed SMS or email notices Patron <borrowernumber>: <borrower firstname> <borrower surname> is currently restricted due to having an invalid SMS number. No new restriction applied" 23. Repeat step 16 and notice no new debarment has been added to those borrowers as they have already been restricted from having a failed SMS notice. 24. In the Koha home directory run the command: prove t/db_dependent/Koha/Notices.t This unit test contains the tests for the new subroutines added to Koha/Notice/Message.pm which are restrict_patron_when_notice_fails() and get_failed_notices() 25. All tests should pass 26. Sign off Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #27 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172539 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172539&action=edit Bug 23295: (follow-up) Add 'NOTICE_FAILURE_SUSPENSION' as a new system restriction type Sponsored-by: Catalyst IT Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #28 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172540&action=edit Bug 23295: (QA follow-up) Fix up qa script issues Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #29 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Thanks so much Kyle! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|no-sandbox |additional_work_needed, | |release-notes-needed --- Comment #30 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've reviewed the code and the test plan and found some things: 1) Configuration (question) get_failed_notices takes days as a parameter, but it's always used with the default (7) or explicitly with 7. So it will always check all notices sent in the last 7 days. Should we include a note in the system preference about this timeframe? 2) Terminology (solved) say "There are borrowers with failed SMS or email notices" if $verbose; borrowers => patrons Fixed in follow-up. 3) Database update (for future reference) Please submit database updates in a single atomicupdate file (less work for RM who has to combine them manually). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #31 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #32 from Jonathan Druart <jonathan.druart@gmail.com> --- We should not try catch without rethrow. Please adjust the db rev: Simply remove the try-catch block. See bug 37895 for more details. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #33 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #32)
We should not try catch without rethrow. Please adjust the db rev: Simply remove the try-catch block.
See bug 37895 for more details.
See bug 38394. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #34 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #32)
We should not try catch without rethrow. Please adjust the db rev: Simply remove the try-catch block.
See bug 37895 for more details.
We can make that change. Should that be attached here or to a new follow-up bug report? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #35 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Aleisha Amohia from comment #34)
(In reply to Jonathan Druart from comment #32)
We should not try catch without rethrow. Please adjust the db rev: Simply remove the try-catch block.
See bug 37895 for more details.
We can make that change. Should that be attached here or to a new follow-up bug report?
It's done on bug 38394. However there is still a question from Katrin waiting for an answer. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38404 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38404 [Bug 38404] Make clear in RestrictPatronsWithFailedNotices syspref description that restrict_patrons_with_failed_notices.pl cronjob has default days setting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #36 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Katrin Fischer from comment #30)
I've reviewed the code and the test plan and found some things:
1) Configuration (question)
get_failed_notices takes days as a parameter, but it's always used with the default (7) or explicitly with 7.
So it will always check all notices sent in the last 7 days.
Should we include a note in the system preference about this timeframe?
Yes that's fair - have reported Bug 38404 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #37 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Aleisha Amohia from comment #36)
(In reply to Katrin Fischer from comment #30)
I've reviewed the code and the test plan and found some things:
1) Configuration (question)
get_failed_notices takes days as a parameter, but it's always used with the default (7) or explicitly with 7.
So it will always check all notices sent in the last 7 days.
Should we include a note in the system preference about this timeframe?
Yes that's fair - have reported Bug 38404
Have also reported Bug 38405 to make the script take a --days param -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Philip Orr <philip.orr@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |philip.orr@lmscloud.de Keywords|release-notes-needed | Text to go in the| |This enhancement adds the release notes| |new system preference | |'RestrictPatronsWithFailedN | |otices' to allow Koha to | |automatically restrict | |patrons when SMS or E-Mail | |notices fail to reach them. | |The system preference is | |turned off by default. To | |turn it on, set the system | |preference to 'Apply'. This | |system preference requires | |the | |misc/cronjobs/restrict_patr | |ons_with_failed_notices.pl | |cronjob. --- Comment #38 from Philip Orr <philip.orr@lmscloud.de> --- added release notes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement adds the |This enhancement adds the release notes|new system preference |new system preference |'RestrictPatronsWithFailedN |'RestrictPatronsWithFailedN |otices' to allow Koha to |otices' to allow Koha to |automatically restrict |automatically restrict |patrons when SMS or E-Mail |patrons when SMS or email |notices fail to reach them. |notices fail to reach them. |The system preference is |The system preference is |turned off by default. To |turned off by default. To |turn it on, set the system |turn it on, set the system |preference to 'Apply'. This |preference to 'Apply'. This |system preference requires |system preference requires |the |the |misc/cronjobs/restrict_patr |misc/cronjobs/restrict_patr |ons_with_failed_notices.pl |ons_with_failed_notices.pl |cronjob. |cronjob. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable --- Comment #39 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 24.05.x backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #40 from David Nind <david@davidnind.com> --- Changed status to needs documenting - enhancement to notices, new system preference, new cronjob. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39010 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39010 [Bug 39010] Allow RestrictPatronsWithFailedNotices to take a days variable, set in intranet -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Cheryl <clackman@fargolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clackman@fargolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39550 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39550 [Bug 39550] RestrictPatronsWithFailedNotices system preference should not be in Patron relationships section -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Marion Durand <marion.durand@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marion.durand@biblibre.com --- Comment #41 from Marion Durand <marion.durand@biblibre.com> --- When sending SMS, there is a check to avoid sending the same SMS twice in a day. The duplicated SMS is set to failed, but it should not restrict the patron. Is this special case taken into account ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |39749 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39749 [Bug 39749] RestrictPatronsWithFailedNotices should not trigger for DUPLICATE_MESSAGE failures -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 --- Comment #42 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Marion Durand from comment #41)
When sending SMS, there is a check to avoid sending the same SMS twice in a day. The duplicated SMS is set to failed, but it should not restrict the patron.
Is this special case taken into account ?
I does not, see bug 39749 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk Documentation| |Aude Charillon contact| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/1065 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23295 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED --- Comment #43 from Aude Charillon <aude.charillon@openfifth.co.uk> --- System preference and script documented in the Koha Manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org