Bug 19417: Display full error text when problem importing records

To test:
1 - Upload a file to stage
2 - Select your import options
3 - Delete the file from the server, example:
    sudo rm /tmp/koha_kohadev_uploads/
4 - 'Click stage for import'
5 - Get an alert 'Failed to submit form: error'
6 - Apply patches
7 - Repeat 1-4
8 - Get a pretty error with additional info

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2017-10-05 15:26:46 +00:00
parent 40d0a77a01
commit 3d167645be
3 changed files with 4 additions and 2 deletions

View file

@ -75,7 +75,6 @@ var humanMsg = {
bindEvents: function() {
// Remove message if mouse is moved or key is pressed
jQuery(document)
.mousemove(humanMsg.removeMsg)
.click(humanMsg.removeMsg)
.keypress(humanMsg.removeMsg)
},

View file

@ -8,6 +8,8 @@
#fileuploadstatus,#fileuploadfailed,#fileuploadcancel,#jobpanel,#jobstatus,#jobfailed { display : none; }
</style>
[% Asset.css("css/humanmsg.css") %]
</head>
<body id="tools_stage-marc-import" class="tools">
[% INCLUDE 'header.inc' %]
@ -213,6 +215,7 @@
[% Asset.js("js/tools-menu.js") | $raw %]
[% Asset.js("js/background-job-progressbar.js") | $raw %]
[% Asset.js("js/file-upload.js") | $raw %]
[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
<script>
var xhr;
$(document).ready(function(){

View file

@ -69,7 +69,7 @@ function submitBackgroundJob(f) {
backgroundJobProgressTimer = setInterval("updateJobProgress()", 500);
},
error: function(xml, textStatus) {
alert('Failed to submit form: ' + textStatus);
humanMsg.displayMsg( '<p>' + _('Failed to submit form: ') + textStatus + '</p></br>'+xml.responseText, { className: 'humanError' } );
}
});