From: David Cook Date: Fri, 13 Jul 2012 01:50:04 +0000 (+1000) Subject: Bug 8434 - Notice generation fails for Advanced Notices, Item Due, and Overdues when... X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=9e948438ef6a123b65c0b540581958701b93ea24 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 Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- diff --git a/C4/Letters.pm b/C4/Letters.pm index b366fbc51d..b17cb0843e 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -120,7 +120,9 @@ my %letter; sub getletter { my ( $module, $code, $branchcode ) = @_; - if (C4::Context->preference('IndependantBranches') && $branchcode){ + if ( C4::Context->preference('IndependantBranches') + and $branchcode + and C4::Context->userenv ) { $branchcode = C4::Context->userenv->{'branch'}; }