[Bug 8434] New: Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm)
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Priority: P5 - low Change sponsored?: --- Bug ID: 8434 Assignee: gmcharlt@gmail.com Summary: Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm) Severity: enhancement Classification: Unclassified OS: All Reporter: dcook@prosentient.com.au Hardware: All Status: NEW Version: master Component: Architecture, internals, and plumbing Product: Koha Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell. This is due to the call to C4::Context->userenv->{'branch'} in Letters.pm (line 124) coming back as undefined. Since there is no "userenv" context in the shell, it fails everytime. Introduce a check for "userenv", so it doesn't try changing the branch (which is already coming in from elsewhere) to the userenv branch. With this check, notice generation works perfectly. Related to Bug 8198 and Bug 8197. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 10805 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10805&action=edit Bug 8434: Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- David How do you run the notice generation? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to comment #2)
David
How do you run the notice generation?
I'm not personally involved with it (besides testing 3.8), but we have a shell script set up to run the overdue_notices and advanced_notices scripts and then to process_message_queue. Personally, it seems a bit strange that we do it this way. How is it ordinarily accomplished? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> --- Cron jobs normally. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to comment #4)
Cron jobs normally.
This would still be a cron job, but perhaps its purpose is to group together the different nightly scripts. Even as a regular cron job, wouldn't the context for userenv still be missing? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Yep the reason it hasn't been spotted is it only happens with independent branches on. (You can set the userenv by calling C4::Context->set_userenv if you want) But the if statement is harmless in that case, and stops an error in other cases. Signing off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10805|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 10806 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10806&action=edit Bug 8434 - Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm) Patch introduces a check for C4::Context->userenv in Letters.pm, so that script doesn't fail when it calls to C4::Context->userenv->{branch}, when run from shell. Without the check, Advanced Notices, Item Due, and Overdues fail to generate. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 kyle.m.hall@gmail.com <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10806|0 |1 is obsolete| | --- Comment #8 from kyle.m.hall@gmail.com <kyle@bywatersolutions.com> --- Created attachment 10831 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10831&action=edit [SIGNED-OFF] Bug 8434 - Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm) Patch introduces a check for C4::Context->userenv in Letters.pm, so that script doesn't fail when it calls to C4::Context->userenv->{branch}, when run from shell. Without the check, Advanced Notices, Item Due, and Overdues fail to generate. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 kyle.m.hall@gmail.com <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10831|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 11078 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11078&action=edit [SIGNED-OFF] Bug 8434 - Notice generation fails for Advanced Notices, Item Due, and Overdues when run in shell (due to error in Letters.pm) QA Comments: The patch fixes the error if getletter is called by a command line script. (This one fixes a bad indentation) Marking as Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_8 Severity|enhancement |normal --- Comment #10 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed, severity updated to "normal" instead of ENH -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8434 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #11 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x, will be in 3.8.4 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org