X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=tools%2Fexport.pl;h=80a15b4cf9c3b6da02580e382379d92fa185d51a;hb=49f2837b2e75511becd09059db99d209917647a7;hp=f63e2c4f6f55432a31a5db9b9c377b69cff9c938;hpb=fcef1ea273bbca6901bb65f6483951e7e71d3828;p=koha.git diff --git a/tools/export.pl b/tools/export.pl index f63e2c4f6f..80a15b4cf9 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -146,7 +146,7 @@ if ( C4::Context->preference("IndependentBranches") @branch = ( C4::Context->userenv->{'branch'} ); } # if stripping nonlocal items, use loggedinuser's branch -my $localbranch = C4::Context->userenv->{'branch'}; +my $localbranch = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; my %branchmap = map { $_ => 1 } @branch; # for quick lookups @@ -166,7 +166,8 @@ if ( $op eq "export" ) { binmode STDOUT, ':encoding(UTF-8)' if $filename =~ m/\.gz$/ - or $filename =~ m/\.bz2$/; + or $filename =~ m/\.bz2$/ + or $output_format ne 'csv'; if ( $filename =~ m/\.gz$/ ) { $mimetype = 'application/x-gzip';