Bugzilla – Attachment 68910 Details for
Bug 19420
Improve display of errors from failure of uploading file during stage import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19420 - Add errors on other pages
Bug-19420---Add-errors-on-other-pages.patch (text/plain), 4.65 KB, created by
Nick Clemens (kidclamp)
on 2017-11-03 10:41:23 UTC
(
hide
)
Description:
Bug 19420 - Add errors on other pages
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-11-03 10:41:23 UTC
Size:
4.65 KB
patch
obsolete
>From 537a6c2c4ba9e1ab6783224a65f1ed69f3b4a5c7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Nov 2017 10:33:00 +0000 >Subject: [PATCH] Bug 19420 - Add errors on other pages > >Eventually these should all be using the same code in a js file > >upload.tt already dealt with these errors, but has diff code, made it >work with new error syntax >--- > koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt | 6 ++++-- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt | 6 ++++-- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 6 +++--- > 3 files changed, 11 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt >index 26937d9..58b69b2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt >@@ -34,7 +34,7 @@ function StartUpload() { > xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload ); > } > >-function cbUpload( status, fileid ) { >+function cbUpload( status, fileid, errors ) { > if( status=='done' ) { > $("form#processfile #uploadedfileid").val( fileid ); > $("form#enqueuefile #uploadedfileid").val( fileid ); >@@ -42,10 +42,12 @@ function cbUpload( status, fileid ) { > $("#processfile").show(); > $("#enqueuefile").show(); > } else { >+ var errMsgs = [ _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ]; >+ var errCode = errors[$('#fileToUpload').prop('files')[0].name].code; > $("#fileuploadstatus").hide(); > $("#fileuploadfailed").show(); > $("#fileuploadfailed").text( _("Upload status: ") + >- ( status=='failed'? _("Failed"): >+ ( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]: > ( status=='denied'? _("Denied"): status )) > ); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >index 82f5912..6b08741 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >@@ -18,16 +18,18 @@ function StartUpload() { > $("#uploadedfileid").val(''); > xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload ); > } >-function cbUpload( status, fileid ) { >+function cbUpload( status, fileid, errors ) { > if( status=='done' ) { > $("#uploadedfileid").val( fileid ); > $('#fileToUpload').prop('disabled',true); > $("#processfile").show(); > } else { >+ var errMsgs = [ _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ]; >+ var errCode = errors[$('#fileToUpload').prop('files')[0].name].code; > $("#fileuploadstatus").hide(); > $("#fileuploadfailed").show(); > $("#fileuploadfailed").text( _("Upload status: ") + >- ( status=='failed'? _("Failed"): >+ ( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]: > ( status=='denied'? _("Denied"): status )) > ); > $("#processfile").hide(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >index 5b61b6b..23f5302 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >@@ -196,12 +196,12 @@ > <script type="text/javascript"> > //<![CDATA[ > var errMESSAGES = [ >- "Error 0: Not in use", >+ "Error 0: Not in use", //We only return 1 - 4 > _("This file already exists (in this category)."), > _("File could not be created. Check permissions."), > _("Your koha-conf.xml does not contain a valid upload_path."), > _("No temporary directory found."), >- _("File could not be read."), >+ _("File could not be read."), //Next three errors have no code path to trigger that I see > _("File has been deleted."), > _("File or upload record could not be deleted."), > ]; >@@ -265,7 +265,7 @@ function ShowAlerts(err) { > var str = ''; > for( var file in err ) { > str= str + '<p>' + file + ': ' + >- errMESSAGES[ err[file] ] + '</p>'; >+ errMESSAGES[ err[file].code ] + '</p>'; > } > if( str ) { > $('#myalerts').html(str); >-- >2.1.4
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 19420
:
67685
|
68292
|
68365
|
68909
|
68910
|
68941
|
68960
|
68961
|
68962
|
68963