Bugzilla – Attachment 117949 Details for
Bug 27869
QotD CSV upload JavaScript errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27869: let user know something went wrong with csv upload
Bug-27869-let-user-know-something-went-wrong-with-.patch (text/plain), 1.92 KB, created by
David Nind
on 2021-03-08 19:19:06 UTC
(
hide
)
Description:
Bug 27869: let user know something went wrong with csv upload
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-03-08 19:19:06 UTC
Size:
1.92 KB
patch
obsolete
>From b453a9d2b2afe2d9b43ae7e97608f7a6c9314769 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 4 Mar 2021 19:37:10 +0000 >Subject: [PATCH] Bug 27869: let user know something went wrong with csv upload > >To test: >-attempt to upload a malformed CSV file >-nothing happens, check the console and see the error: Uncaught TypeError: arrData[(arrData.length - 1)] is undefined >-apply patch >-try again >-now you should at least see a warning that something went wrong >-attempt to upload a good CSV file, it should work > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >index 867a3628c3..6ef7bbb862 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >@@ -30,6 +30,7 @@ > <div class="import_errors dialog alert" style="display: none;"></div> > </div> > >+ <div id="csv_error" class="alert" style="visibility: hidden;">Something went wrong, check your CSV file.</div> > <div id="instructions"> > <fieldset id="file_uploader_help" class="rows"> > <legend>Instructions</legend> >@@ -217,7 +218,11 @@ > > // Now that we have our value string, let's add > // it to the data array. >- arrData[ arrData.length - 1 ].push( strMatchedValue ); >+ if ( arrData[ arrData.length - 1 ] ) { >+ arrData[ arrData.length - 1 ].push( strMatchedValue ); >+ } else { >+ $('#csv_error').css( 'visibility' , 'visible' ); >+ } > } > > // Return the parsed data. >-- >2.11.0
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 27869
:
117760
|
117875
|
117949
|
119071