Bug 19417: Display full error text when problem importing records
authorNick Clemens <nick@bywatersolutions.com>
Thu, 5 Oct 2017 15:26:46 +0000 (15:26 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 13 Mar 2019 05:31:33 +0000 (05:31 +0000)
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>

koha-tmpl/intranet-tmpl/lib/jquery/plugins/humanmsg.js
koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt
koha-tmpl/intranet-tmpl/prog/js/background-job-progressbar.js

index 347d345..a4c1ab9 100644 (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)
        },
index 4222fdc..9276129 100644 (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' %]
     [% 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(){
index cc08618..66dac87 100644 (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' } );
             }
 
         });