Bugzilla – Attachment 68292 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 - Improve display of errors from failure of uploading file during stage import
Bug-19420---Improve-display-of-errors-from-failure.patch (text/plain), 2.66 KB, created by
Nick Clemens (kidclamp)
on 2017-10-19 10:43:34 UTC
(
hide
)
Description:
Bug 19420 - Improve display of errors from failure of uploading file during stage import
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-19 10:43:34 UTC
Size:
2.66 KB
patch
obsolete
>From 2411c6d7884cd69f69925668fd0d28987b738b9e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 Oct 2017 10:39:23 +0000 >Subject: [PATCH] Bug 19420 - Improve display of errors from failure of > uploading file during stage import > >To test: >1 - sudo chown www-data:www-data /tmp/koha_kohadev_upload/ (or your > relevant dir and user) >2 - Attempt to stage a file >3 - Error message is: Upload status: Failed >4 - Apply patch >5 - Repeat upload >6 - Error is now: Failed - Directory is not writeable: >/tmp/koha_kohadev_upload >7 - Trigger the other errors if you can and note better responses >--- > Koha/Uploader.pm | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt | 6 ++++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/Koha/Uploader.pm b/Koha/Uploader.pm >index 844c166..7a02d11 100644 >--- a/Koha/Uploader.pm >+++ b/Koha/Uploader.pm >@@ -153,7 +153,7 @@ sub err { > my $err; > foreach my $f ( keys %{ $self->{files} } ) { > my $e = $self->{files}->{$f}->{errcode}; >- $err->{ $f } = $e if $e; >+ $err->{ $f }->{code} = $e if $e; > } > return $err; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >index 3229ea6..c95c88e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt >@@ -59,7 +59,7 @@ function CancelUpload() { > $("#fileuploadfailed").show(); > $("#fileuploadfailed").text( _("Upload status: Cancelled ") ); > } >-function cbUpload( status, fileid ) { >+function cbUpload( status, fileid, errors ) { > if( status=='done' ) { > $("#uploadedfileid").val( fileid ); > $('#fileToUpload').prop('disabled',true); >@@ -72,12 +72,14 @@ function cbUpload( status, fileid ) { > } > $("#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; > $('#fileuploadbutton').show(); > $("#fileuploadcancel").hide(); > $("#fileuploadstatus").hide(); > $("#fileuploadfailed").show(); > $("#fileuploadfailed").text( _("Upload status: ") + >- ( status=='failed'? _("Failed"): >+ ( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]: > ( status=='denied'? _("Denied"): status )) > ); > } >-- >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