If patron P has two overdue items: I1 from branch B1 and I2 from branch B2, then overdue_notices.pl will produce two emails coming from B1 and B2 that have the same list of BOTH items I1 AND I2 in BOTH emails. I believe that this is not an intended behavior and that each email coming from each branch should show overdue items belonging to that respective branch only. Steps to reproduce: 0/ Have (or create) at least two branches B1 and B2 1/ Make sure you're logged in with an account belonging to B1, or switch to branch B1 2/ checkout item I1 (belonging to B1) to patron P (preferably while specifying a due date < today) 3/ switch to branch B2 4/ checkout item I2 (belonging to B2) to patron P (preferably while specifying a due date < today) 5/ make sure you have defined "Overdue notice/status triggers" for that patron category, ie with Delay=1 so that "Overdue Notice" is selected and "Email" is checked. 6/ from cli run 'perl ./misc/cronjobs/overdue_notices.pl' (optionally specifying also '-library B1 -library B2') 7/ (at least) two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items 8/ either see the 'content' field in these entries, or run 'perl ./cronjobs/process_message_queue.pl' to receive the actual emails (provided the email is properly setup) I have verified the same behavior with versions 3.20.x, 3.22.x and master (but must also apply to all recent Koha versions).
Created attachment 57298 [details] [review] Bug 17470 Make overdue notices according to branch item only As a test plan I redirect you to the steps described by Theodoros : 1) do these steps 2) apply the patch 3) redo them. Olivier Crouzet
Thank you Olivier for the patch! I can verify that the patch works as expected for 3.20 and master. Having said that, I leave it as 'Needs Signoff'. Maybe @Kyle or someone from QA team could/should sign it off?
Hi Theodorus, if it works for you on master, please sign off! The QA team will take over from there.
Created attachment 57429 [details] [review] Bug 17470 Make overdue notices according to branch item only I replaced the "items.homebranch" chunk in the sql query by "issues.branchcode" which I think is a better choice considered the fact that the holdingbranch is more likely to do the claim. I must add that we can observe the same behaviour described by Theodoros with the library option and this patch deals with it as well : if you have 2 branches, say A et B, and a claim of same delay on them, by now you get 2 messages. it's Ok, but both of them list also the claimed item of the other one. Olivier Crouzet
The patch that has been signoff is not the one that is attached now. Another signoff is required. Please provide a complete test plan to make sure the tester will test all the different cases.
Test plan 0/ Have (or create) at least two branches B1 and B2 1/ Make sure you're logged in with an account belonging to B1, or switch to branch B1 2/ checkout item I1 (belonging to B1) to patron P while specifying a due date < today) 3/ switch to branch B2 4/ checkout item I2 (belonging to B2) to patron P while specifying a due date < today) 5/ make sure you have defined "Overdue notice/status triggers" for that patron category, ie with Delay=1 so that "Overdue Notice" is selected and "Email" is checked. 6/ from cli run 'perl ./misc/cronjobs/overdue_notices.pl' 7/ two new entries will be generated in message_queue DB table, coming from different branches that have the SAME list of overdue items 8/ either see the 'content' field in these entries, or run 'perl ./cronjobs/process_message_queue.pl' to receive the actual emails (provided the email is properly setup) 9) run again overdue_notices.pl with library option for both B1 and B2 (you must give the branchcode as parameter) like this : ./overdue_notices.pl -t -library B1branchcode -library B2branchcode 10) see again that the generated messages have the same list of overdue items 11) apply the patch 12) run again the script first without library option and secondly with it : in both cases, 2 messages will be created. One from B1 claiming the B1 item, another from B2 claiming the B2 item.
Created attachment 57791 [details] [review] Bug 17470 Make overdue notices according to branch item only When a patron had overdues on items from different branches he received from each corresponding branch a notice claiming the complete list of these items. Signed-off-by: sbujam <sbujam@users.noreply.github.com>
Created attachment 58116 [details] [review] Bug 17470 Make overdue notices according to branch item only When a patron had overdues on items from different branches he received from each corresponding branch a notice claiming the complete list of these items. Signed-off-by: sbujam <sbujam@users.noreply.github.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master for 17.05, thanks Olivier!
I am hesitating to push this to stable as it's a change in behavior and might come as a surprise. I think this would be better in a feature release with information added to the field for the release notes documentation. I am changing this to an enhancement.