Bugzilla – Attachment 176325 Details for
Bug 36831
Add support for .txt files to the KBART import tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36831: Allow for multiple file types
Bug-36831-Allow-for-multiple-file-types.patch (text/plain), 3.47 KB, created by
David Nind
on 2025-01-10 13:14:22 UTC
(
hide
)
Description:
Bug 36831: Allow for multiple file types
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-01-10 13:14:22 UTC
Size:
3.47 KB
patch
obsolete
>From 0d4c038630fd17cf2af6b38ad1e18e71e2f29048 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 3 Jul 2024 09:52:45 +0000 >Subject: [PATCH] Bug 36831: Allow for multiple file types > >This patch allows the KBART import tool to accept different filetypes and then work out whether they are CSV or TSV files. > >Test plan: >1) Try to import the file attached to the bug using the KBART import tool (E-resource management > eHoldings > Local > Titles > Import from a KBART file) >2) It should return an error saying that the file must be .csv or .tsv >3) Apply patch >4) yarn build >5) restart_all >6) Repeat step 1 >7) The file should now successfully import > >squash > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/ERM/EHoldings/Title.pm | 4 ++-- > .../ERM/EHoldingsLocalTitlesKBARTImport.vue | 17 +---------------- > 2 files changed, 3 insertions(+), 18 deletions(-) > >diff --git a/Koha/ERM/EHoldings/Title.pm b/Koha/ERM/EHoldings/Title.pm >index 73e4d53846..15abf6e33a 100644 >--- a/Koha/ERM/EHoldings/Title.pm >+++ b/Koha/ERM/EHoldings/Title.pm >@@ -141,7 +141,7 @@ sub read_file { > return ( $column_headers, $lines, $error ); > } > >- return ( $column_headers, $lines ); >+ return ( $column_headers, $lines, '' ); > } > > >@@ -268,7 +268,7 @@ sub _detect_delimiter_and_quote { > my %quote_count; > > foreach my $line (@lines) { >- foreach my $char ( ',', '\t', ';', '|' ) { >+ foreach my $char ( ",", "\t", ";", "|" ) { > my $count = () = $line =~ /\Q$char\E/g; > $delimiter_count{$char} += $count if $count; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue >index d2d18bb194..4edb78ee27 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue >@@ -2,21 +2,6 @@ > <h2>{{ $__("Import from a KBART file") }}</h2> > <div class="page-section" id="files"> > <form @submit="addDocument($event)" class="file_upload"> >- <h3>{{ $__("Requirements:") }}</h3> >- <ul style="margin-bottom: 1.5em"> >- <li>{{ $__("The file must be in TSV or CSV format") }}</li> >- <li> >- {{ >- $__( >- "The file should not contain any additional information / header rows, e.g. a file with a single title would be structured as follows:" >- ) >- }} >- <ol> >- <li>{{ $__("Column headings row") }}</li> >- <li>{{ $__("Title data row") }}</li> >- </ol> >- </li> >- </ul> > <fieldset class="rows" id="package_list"> > <h3>{{ $__("Select file for upload") }}:</h3> > <ol> >@@ -174,7 +159,7 @@ export default { > } > if (success.warnings.invalid_filetype) { > message += `<p>${this.$__( >- "The file must be in .tsv or .csv format, please convert your file and try again." >+ "Could not detect whether the file is TSV or CSV, please check the file." > )}</p>` > this.setWarning(message) > } >-- >2.39.5
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 36831
:
166958
|
166959
|
166960
|
166961
|
166989
|
166990
|
166991
|
168431
|
168432
|
168433
|
168434
|
170549
|
170550
|
170551
|
170552
|
170562
|
170563
|
170564
|
170565
|
176319
|
176320
|
176321
|
176322
|
176323
|
176324
|
176325
|
176326
|
176347