From d4cc6054e05c281da3808c0fd722559ce05a9d48 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 09:30:27 +0100 Subject: [PATCH] Bug 23777: Use TO.json in value_builder/unimarc_field_4XX.tt No idea how to test this but, as other fixes work, this one should, right? Signed-off-by: Hayley Mapley Signed-off-by: Martin Renvoize --- .../value_builder/unimarc_field_4XX.tt | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt index 2268a0953c..7f139830ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt @@ -1,4 +1,6 @@ [% SET footerjs = 1 %] +[% USE raw %] +[% USE To %] [% INCLUDE 'doc-head-open.inc' %] Koha › Cataloging › 4XX plugin [% INCLUDE 'doc-head-close.inc' %] @@ -167,55 +169,55 @@ var subfield = subfields[i+1]; if(code.value == '9'){ - subfield.value = "[% subfield_value_9 |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_9 ) | $raw ]"; } if(code.value == '0'){ - subfield.value = "[% subfield_value_0 |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_0 ) | $raw ]"; } if(code.value == 'a'){ - subfield.value = "[% subfield_value_a |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_a ) | $raw ]"; } if(code.value == 'c'){ - subfield.value = "[% subfield_value_c |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_c ) | $raw ]"; } if(code.value == 'd'){ - subfield.value = "[% subfield_value_d |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_d ) | $raw ]"; } if(code.value == 'e'){ - subfield.value = "[% subfield_value_e |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_e ) | $raw ]"; } if(code.value == 'h'){ - subfield.value = "[% subfield_value_h |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_h ) | $raw ]"; } if(code.value == 'i'){ - subfield.value = "[% subfield_value_i |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_i ) | $raw ]"; } if(code.value == 'l'){ - subfield.value = "[% subfield_value_l |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_l ) | $raw ]"; } if(code.value == 'n'){ - subfield.value = "[% subfield_value_n |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_n ) | $raw ]"; } if(code.value == 'o'){ - subfield.value = "[% subfield_value_o |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_o ) | $raw ]"; } if(code.value == 'p'){ - subfield.value = "[% subfield_value_p |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_p ) | $raw ]"; } if(code.value == 't'){ - subfield.value = "[% subfield_value_t |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_t ) | $raw ]"; } if(code.value == 'u'){ - subfield.value = "[% subfield_value_u |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_u ) | $raw ]"; } if(code.value == 'v'){ - subfield.value = "[% subfield_value_v |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_v ) | $raw ]"; } if(code.value == 'x'){ - subfield.value = "[% subfield_value_x |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_x ) | $raw ]"; } if(code.value == 'y'){ - subfield.value = "[% subfield_value_y |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + subfield.value = "[% To.json( subfield_value_y ) | $raw ]"; } } } -- 2.39.5