Bugzilla – Attachment 167130 Details for
Bug 36935
BackgroundJob/ImportKBARTFile.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36935: Remove warning if file parsing is successful
Bug-36935-Remove-warning-if-file-parsing-is-succes.patch (text/plain), 1.60 KB, created by
David Nind
on 2024-05-23 20:08:03 UTC
(
hide
)
Description:
Bug 36935: Remove warning if file parsing is successful
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-05-23 20:08:03 UTC
Size:
1.60 KB
patch
obsolete
>From e6794caea73cbf960404e0b7fb87efc894827b56 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 23 May 2024 08:32:22 +0000 >Subject: [PATCH] Bug 36935: Remove warning if file parsing is successful > >This patch removes the logged warning if a file parse is successful. > >Test plan: >1) prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >2) The output will have a logged message - 'EOF - End of data in parsing input stream' >3) Apply patch >4) Repeat step 1 >5) The warning will be gone > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/BackgroundJob/ImportKBARTFile.pm | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/Koha/BackgroundJob/ImportKBARTFile.pm b/Koha/BackgroundJob/ImportKBARTFile.pm >index d17dcf502f..b1da1bb06f 100644 >--- a/Koha/BackgroundJob/ImportKBARTFile.pm >+++ b/Koha/BackgroundJob/ImportKBARTFile.pm >@@ -241,14 +241,16 @@ sub read_file { > my $headers_to_check = $csv->getline($fh); > my $column_headers = rescue_EBSCO_files($headers_to_check); > my $lines = $csv->getline_all( $fh, 0 ); >- >- my ( $cde, $str, $pos ) = $csv->error_diag(); >- my $error = $cde ? "$cde, $str, $pos" : ""; >- warn $error if $error; >- > close($fh); > >- return ( $column_headers, $lines, $error ); >+ unless($csv->eof()) { >+ my ( $cde, $str, $pos ) = $csv->error_diag(); >+ my $error = $cde ? "$cde, $str, $pos" : ""; >+ warn $error if $error; >+ return ( $column_headers, $lines, $error ); >+ } >+ >+ return ( $column_headers, $lines ); > } > > =head3 create_title_hash_from_line_data >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36935
:
167078
|
167080
|
167088
|
167089
|
167099
|
167130
|
167131
|
167132
|
168326
|
168327
|
168328