From 638b7225ae2507a708313c7766b9e71a6d891289 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Thu, 13 Mar 2014 11:58:18 +0100 Subject: [PATCH] Bug 9811: Fixing JSON validation error for non-javascript string literal characters Issue: When a patron has backslashes in his circulation notes, the JSON transportation layer cannot send the message because it will fail JSON validation when trying to validate backslashed non-literal characters (\s \d ...). This causes the whole search to fail when even one Borrower has a non-literal backslashed character in his notes. Solution: The Borrowers' circulation notes are filtered through a regexp which doubles all backslashes to prepare them for the JSON validation routine. Result: Backslashes pass through unchanged. Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/members/tables/members_results.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt index 1a975b9896..5cb8cfda6b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt @@ -24,7 +24,7 @@ "dt_fines": "[% IF data.fines < 0 %][% data.fines |html %] [% ELSIF data.fines > 0 %] [% data.fines |html %] [% ELSE %] [% data.fines |html%] [% END %]", "dt_borrowernotes": - "[% data.borrowernotes |html |html_line_break |collapse %]", + "[% data.borrowernotes.replace('\\\\' , '\\\\') |html |html_line_break |collapse %]", "dt_action": "[% IF data.category_type %]Edit[% ELSE %][% IF data.categorycode %]Edit[% ELSE %]Edit[% END %][% END %]", "borrowernumber": -- 2.39.5