From 850320a7d516a5c7d6bc919b4f746ec562889aca Mon Sep 17 00:00:00 2001 From: Claire Gravely Date: Fri, 30 Nov 2018 10:38:33 +0000 Subject: [PATCH] Bug 21716: Item Search hangs when \ exists in MARC fields When there are \ (backslashes) in MARC records the item search hangs when trying to load the page the record should appear on. It gets stuck on processing. This patch fixes this issue. To Test: 1. Create or edit a biblio and add in \ to the publisher field. eg: Narr\Francke\Attempto 2. Make sure this biblio has items attached that you can search for 3. Do an item search which would include the edited biblio in the results - a general search for a home library or shelving location will work 4. Try to load All results (or the page with the edited biblio) The page will hang :-( 5. Apply patch 6. Perform the item search again 7. Try to load All results The page will load :-) Mentored by: Martin Renvoize --- .../intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc index 45b43f6..994ca24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc @@ -1,8 +1,9 @@ [%- USE Branches -%] [%- USE Koha -%] [% USE AuthorisedValues %] +[% USE JSON.Escape %] [%- biblio = item.biblio -%] -[%- biblioitem = item.biblioitem -%] +[%- biblioitem = item.biblioitem | json -%] [ "[% FILTER escape_quotes = replace('"', '\"') ~%] [% biblio.title | html %][% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %] by[% END %] [% biblio.author | html %] -- 2.1.4