Bug 14044: Escape json strings for patron searches
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 22 Apr 2015 13:39:55 +0000 (09:39 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 6 May 2015 13:29:08 +0000 (10:29 -0300)
commita0ccc0d246d61e0a7e8b6936ef4eba9a77f599d8
tree670c9fb2e83d14e799856c884556d21fee54c780
parent9d50a1189d05618f6ef12d6f8696cab57861aba9
Bug 14044: Escape json strings for patron searches

In a couple of patron searches, the address is displayed.
If the address contain invalid json characters, DataTables won't manage
to parse the results and display them.
This patch makes the templates more readable by creating a BLOCK instead
of a long line and escape the invalid json characters calling the TT
plugin (To.json).

Test plan:
Edit a patron and add something like:
    patron <address> \123 ☎ ⚑
in the address field.

Search for this patron using the main patron search (members/member.pl)
and the guarantor search.
Confirm that a result with this patron is correctly displayed.

Regression test: Since Koha::Template::Plugin::To::json is modified,
confirm that the add users to basket search (on acqui/basket.pl?basketno=X
click on the "Add user" button) still works as expected.

Signed-off-by: Christopher Brannon <cbrannon@cdalibary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/Template/Plugin/To.pm
koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/guarantor_search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt