When running the tests a user is not logged in so C4::Context->userenv

does not exist, stopping the tests erroring
This commit is contained in:
Chris Cormack 2011-04-13 11:52:28 +12:00
parent c9d082bcdc
commit 25d6beb805

View file

@ -352,7 +352,8 @@ should be the empty string.
sub manualinvoice {
my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_;
my $manager_id = C4::Context->userenv->{'number'};
my $manager_id = 0;
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv->{'number'};
my $dbh = C4::Context->dbh;
my $notifyid = 0;
my $insert;