From 8094ee69057e2522f771061857ade2240ace8cf5 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 Signed-off-by: Chris Cormack --- tools/export.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/export.pl b/tools/export.pl index 97415f8..2d51de2 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -206,8 +206,11 @@ if ( $op eq "export" ) { my $authtype = $query->param('authtype'); my $filefh; if ($commandline) { - open $filefh,"<", $id_list_file or die "cannot open $id_list_file: $!" if $id_list_file; - } else { + if ($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"); } my %id_filter; -- 2.1.0