Bug 31138: Don't ignore DataTables errors and raise them to the end-user
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 12 Jul 2022 08:09:25 +0000 (10:09 +0200)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Mon, 19 Sep 2022 21:44:00 +0000 (23:44 +0200)
commit5081ea2243207a5b58d3e3bac0e5b9fc97178181
tree3cee8219c69351072499d7287532e5ac3ea047cd
parenta05978b72f7707756744474282b4c8dc5a5c043e
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 76b984bb6ccee55ba1ddfdb5b08c6ee2e75eaa37)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 7a5d048b51b60dcb7123e2fd0b73e5d95f9e554e)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
(cherry picked from commit 6ac8f34e9906d840cb6b8e04427f064f2d9518b3)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
koha-tmpl/intranet-tmpl/prog/js/datatables.js