From 0ed5c33dc5cb6daae74e74db254eeec447eca90e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 4 Nov 2014 12:42:27 -0500 Subject: [PATCH] Bug 13197 - Export.pl errors out on command line if --id_list_file is not provided If one attempts to run export.pl from the command line without the --id_list_file switch, it errors out with the following message: cannot open 0: No such file or directory at /usr/share/koha/intranet/cgi-bin/tools/export.pl line 209. Test Plan: 1) Run tools/export.pl from the command line without the --id_list_file option 2) Note the error 3) Apply this patch 4) Repeat step 1 5) Note the error does not occur --- tools/export.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/export.pl b/tools/export.pl index 658aef7..69e724a 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -205,7 +205,7 @@ if ( $op eq "export" ) { my $ending_authid = $query->param('ending_authid'); my $authtype = $query->param('authtype'); my $filefh; - if ($commandline) { + if ($commandline && $id_list_file) { open $filefh,"<", $id_list_file or die "cannot open $id_list_file: $!" if $id_list_file; } else { $filefh = $query->upload("id_list_file"); -- 1.7.2.5