Bug 33900 - advance_notices.pl cronjob hangs
Summary: advance_notices.pl cronjob hangs
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 20478
Blocks: 34059
  Show dependency treegraph
 
Reported: 2023-06-05 15:34 UTC by Pedro Amorim
Modified: 2023-12-28 20:47 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.02,22.11.08
Circulation function:


Attachments
Bug 33900: Fix handling of due_digest (1.81 KB, patch)
2023-06-05 15:39 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33900: Fix handling of due_digest (1.86 KB, patch)
2023-06-05 16:10 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 33900: Fix handling of due_digest (1.91 KB, patch)
2023-06-08 11:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2023-06-05 15:34:45 UTC

    
Comment 1 Pedro Amorim 2023-06-05 15:39:29 UTC
Created attachment 152003 [details] [review]
Bug 33900: Fix handling of due_digest

Test plan, on k-t-d
1) Go to 'my account'
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter a barcode e.g. 39999000001372 and press checkout
6) Run the following query to force the due_date to be equal to 'todays' date:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-05 23:59:00' where issue_id = 1;

7) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

8) Notice it hangs, it's stuck on an infinite loop on the 2nd while cycle after if ()
9) Cancel the cronjob script, apply patch
10) Run the cronjob script again (step 7), notice it finishes
11) Access patron's notices:
/cgi-bin/koha/members/notices.pl?borrowernumber=51

Check that the 'Item due reminder' notice is there.
Comment 2 Sam Lau 2023-06-05 16:10:51 UTC
Created attachment 152004 [details] [review]
Bug 33900: Fix handling of due_digest

Test plan, on k-t-d
1) Go to 'my account'
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter a barcode e.g. 39999000001372 and press checkout
6) Run the following query to force the due_date to be equal to 'todays' date:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-05 23:59:00' where issue_id = 1;

7) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

8) Notice it hangs, it's stuck on an infinite loop on the 2nd while cycle after if ()
9) Cancel the cronjob script, apply patch
10) Run the cronjob script again (step 7), notice it finishes
11) Access patron's notices:
/cgi-bin/koha/members/notices.pl?borrowernumber=51

Check that the 'Item due reminder' notice is there.

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 3 Katrin Fischer 2023-06-08 11:19:34 UTC
Hi Sam, seen you do a lot of sign-offs - THANK YOU :)
Comment 4 Katrin Fischer 2023-06-08 11:20:29 UTC
Created attachment 152159 [details] [review]
Bug 33900: Fix handling of due_digest

Test plan, on k-t-d
1) Go to 'my account'
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter a barcode e.g. 39999000001372 and press checkout
6) Run the following query to force the due_date to be equal to 'todays' date:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-05 23:59:00' where issue_id = 1;

7) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

8) Notice it hangs, it's stuck on an infinite loop on the 2nd while cycle after if ()
9) Cancel the cronjob script, apply patch
10) Run the cronjob script again (step 7), notice it finishes
11) Access patron's notices:
/cgi-bin/koha/members/notices.pl?borrowernumber=51

Check that the 'Item due reminder' notice is there.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi (tcohen) 2023-06-08 11:33:30 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Pedro Amorim 2023-06-19 11:41:56 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2023-07-12 07:01:51 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 8 Matt Blenkinsop 2023-07-12 09:17:00 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x