Bugzilla – Attachment 174920 Details for
Bug 38466
KBART import fails silently if file extension is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38466: Fix error messages in KBART import
Bug-38466-Fix-error-messages-in-KBART-import.patch (text/plain), 3.08 KB, created by
Marcel de Rooy
on 2024-11-22 10:43:57 UTC
(
hide
)
Description:
Bug 38466: Fix error messages in KBART import
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-11-22 10:43:57 UTC
Size:
3.08 KB
patch
obsolete
>From 2e4d0c9700ae0c4b098e88c8d7bcdfeb82d52d32 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 18 Nov 2024 11:49:01 +0000 >Subject: [PATCH] Bug 38466: Fix error messages in KBART import >Content-Type: text/plain; charset=utf-8 > >Test plan: >1) Download the file attached to this bug and save it as a .txt file >2) In the ERM module, create a local package >3) Go to the local titles page and click Import from KBART file >4) Select your package and the saved file and click import >5) The import will fail with just a console error >6) Apply patch and run a restart_all and a yarn js:build >7) Repeat step 4, it should now display an error saying the file must be either TSV or CSV >8) Convert the file to either of those two formats and repeat step 4 >9) The file should now import successfully, with a message saying that there is an additional column "bestppn" that will not be imported > >Signed-off-by: msaby <mathsabypro@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/REST/V1/ERM/EHoldings/Titles/Local.pm | 2 +- > .../vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue | 7 ++++--- > 2 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >index c45d4d6914..ac8818afe5 100644 >--- a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >+++ b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm >@@ -285,7 +285,7 @@ sub import_from_kbart_file { > if ( $file->{filename} !~ /\.csv$/ && $file->{filename} !~ /\.tsv$/ ) { > return $c->render( > status => 201, >- openapi => { invalid_filetype => 1 } >+ openapi => { warnings => { invalid_filetype => 1 } } > ); > } > >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 5049bf9cb0..d2d18bb194 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 >@@ -86,9 +86,10 @@ import { ref, inject } from "vue" > > export default { > setup() { >- const { setMessage } = inject("mainStore") >+ const { setMessage, setWarning } = inject("mainStore") > return { > setMessage, >+ setWarning, > } > }, > data() { >@@ -171,11 +172,11 @@ export default { > )}</p>` > this.setMessage(message, true) > } >- if (success.invalid_filetype) { >+ if (success.warnings.invalid_filetype) { > message += `<p>${this.$__( > "The file must be in .tsv or .csv format, please convert your file and try again." > )}</p>` >- setWarning(message) >+ this.setWarning(message) > } > }, > error => {} >-- >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 38466
:
174646
|
174680
|
174737
| 174920