]> git.koha-community.org Git - koha.git/commit
Bug 37998: Tabs and backslashes in the data break item search display
authorJanusz Kaczmarek <januszop@gmail.com>
Tue, 24 Sep 2024 21:05:32 +0000 (21:05 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 18 Dec 2024 12:31:15 +0000 (13:31 +0100)
commite0a12877f15975432b425059c4d1229c73e71ecb
treebe0010de6fd995d763a0a359cba0aa7b8629acc8
parent9258685b42ba4180fba18bc5e161fda077a392da
Bug 37998: Tabs and backslashes in the data break item search display

If the item data (e.g. callnumber) contains a tab or backslash OR the
title part contains a backslash, the DataTable displaying the item
search results stops throwing an error modal "Something went wrong when
loading the table. 200: OK." and a JS console log: "DataTables warning:
table id=results - Invalid JSON response. For more information about
this error, please see http://datatables.net/tn/1".

Test plan:
==========

1. Make an item search w/o any parameters.
2. From the first result page choose a record and modify the title (245 $a)
   to contain " \ " string. Repeat the item search. You should see a modal
   "Something went wrong when loading the table. 200: OK.".
3. Remove the " \ " from the title.  Verify that the problem no longer occurs.
4. In the same record, insert the string " \ " or a tab (copied from a text
   editor) into item data (itemcallnumber, enumchron, barcode etc.).
5. Repeat the item search. You should see again a modal "Something went wrong
   when loading the table. 200: OK.".
6. Apply the patch; restart_all.
7. Repeat p. 2, 3, 4, and 5.  Verify, that the problem is solved.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit d289ebf0b36dc919f67d9947d6eee862e5362ce5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 76f82167f1803a08ccdf71c650a4a95028d03b24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc
koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc