Bugzilla – Attachment 137615 Details for
Bug 31138
DataTables is not raising error to the end user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31138: Don't ignore DataTables errors and raise them to the end-user
Bug-31138-Dont-ignore-DataTables-errors-and-raise-.patch (text/plain), 1.92 KB, created by
Martin Renvoize (ashimema)
on 2022-07-12 09:45:36 UTC
(
hide
)
Description:
Bug 31138: Don't ignore DataTables errors and raise them to the end-user
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-07-12 09:45:36 UTC
Size:
1.92 KB
patch
obsolete
>From bd4b1e6b57b5ccdc12b586ac8082936fb405005d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 12 Jul 2022 10:09:25 +0200 >Subject: [PATCH] Bug 31138: Don't ignore DataTables errors and raise them to > the end-user > >DataTables is not raising error to the end user, it's only displaying a generic message in the console. >This leads to lot of questions on IRC or the mailing list ("the table is empty"). >We can do better and display what went wrong. > >We could also imagine add a link to the wiki for the more common problems (won't be implemented here however). > >Test plan: >Revert "Bug 31104: Put each link on a separate header" and search for a >patron using a very long string >You should get an alert with the reponse of the server. >In my case: >""" >Something went wrong when loading the table. >414: Request-URI Too Long >""" > >You can also make the REST API returns a 500 (bad specs or simply with a >die statement). > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index e2d8547157..21dfe52636 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -485,7 +485,13 @@ function filterDataTable( table, column, term ){ > } > > jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { >- console.warn(message); >+ if ( settings.jqXHR ) { >+ console.log("Got %s (%s)".format(settings.jqXHR.status, settings.jqXHR.statusText)); >+ alert(__("Something went wrong when loading the table.\n%s: %s").format(settings.jqXHR.status, settings.jqXHR.statusText)); >+ } else { >+ alert(__("Something went wrong when loading the table.")); >+ } >+ console.log(message); > }; > > (function($) { >-- >2.20.1
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 31138
:
137609
|
137615
|
138030