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> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
parent
70588431b6
commit
9e948438ef
1 changed files with 3 additions and 1 deletions
|
@ -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'};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue