Bug 15923: Fix --id_list_file option for misc/export_records.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Feb 2016 10:56:33 +0000 (10:56 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 2 Mar 2016 00:43:11 +0000 (00:43 +0000)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
misc/export_records.pl

index b411425..2783542 100755 (executable)
@@ -173,8 +173,9 @@ elsif ( $record_type eq 'auths' ) {
 }
 
 @record_ids = uniq @record_ids;
-if ( @record_ids and my $id_list_file ) {
-    my @filter_record_ids = <$id_list_file>;
+if ( @record_ids and $id_list_file ) {
+    open my $fh, '<', $id_list_file or die "Cannot open file $id_list_file ($!)";
+    my @filter_record_ids = <$fh>;
     @filter_record_ids = map { my $id = $_; $id =~ s/[\r\n]*$//; $id } @filter_record_ids;
     # intersection
     my %record_ids = map { $_ => 1 } @record_ids;