From b561c2dbd3321374b5f26a66ef90ecb47e5371f9 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 27 Feb 2019 09:43:28 +0100 Subject: [PATCH] Revert "Bug 21986: Do not escape quotation marks when cataloguing" This reverts commit 7e21b1fd2d9e72d3b5f94bd111f0f8f2d8d7e104. Signed-off-by: Fridolin Somers --- authorities/authorities.pl | 2 ++ cataloguing/addbiblio.pl | 2 ++ cataloguing/additem.pl | 1 + members/memberentry.pl | 1 + opac/opac-review.pl | 3 +++ tools/batchMod.pl | 3 ++- 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index 18fa5db63a..7ffb0109ba 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -136,6 +136,8 @@ sub create_input { my $index_subfield = CreateKey(); # create a specifique key for each subfield + $value =~ s/"/"/g; + # determine maximum length; 9999 bytes per ISO 2709 except for leader and MARC21 008 my $max_length = 9999; if ($tag eq '000') { diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 91f6588470..6606ac2625 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -281,6 +281,8 @@ sub create_input { my $index_subfield = CreateKey(); # create a specifique key for each subfield + $value =~ s/"/"/g; + # if there is no value provided but a default value in parameters, get it if ( $value eq '' ) { $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 2ee414d4ae..4a043f92d4 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -128,6 +128,7 @@ sub generate_subfield_form { $subfield_data{repeatable} = $subfieldlib->{repeatable}; $subfield_data{maxlength} = $subfieldlib->{maxlength}; + $value =~ s/"/"/g; if ( ! defined( $value ) || $value eq '') { $value = $subfieldlib->{defaultvalue}; # get today date & replace <>, <>, <
> if provided in the default value diff --git a/members/memberentry.pl b/members/memberentry.pl index 77501b59d8..0798e1f7a7 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -180,6 +180,7 @@ if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) foreach my $key (@names) { if (defined $input->param($key)) { $newdata{$key} = $input->param($key); + $newdata{$key} =~ s/\"/"/g unless $key eq 'borrowernotes' or $key eq 'opacnote'; } } diff --git a/opac/opac-review.pl b/opac/opac-review.pl index 86a9848ba9..b4a26beb93 100755 --- a/opac/opac-review.pl +++ b/opac/opac-review.pl @@ -71,6 +71,9 @@ if( !@errors && defined $review ) { if ($clean ne $review) { push @errors, {scrubbed=>$clean}; } + my $js_ok_review = $clean; + $js_ok_review =~ s/"/"/g; # probably redundant w/ TMPL ESCAPE=JS + $template->param(clean_review=>$js_ok_review); if ($savedreview) { $savedreview->set( { diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 13868fe2a3..8c3b9c8b5d 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -347,7 +347,8 @@ foreach my $tag (sort keys %{$tagslib}) { $subfield_data{mandatory} = $tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable}; my ($x,$value); - if ( $use_default_values) { + $value =~ s/"/"/g; + if ( !$value && $use_default_values) { $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; # get today date & replace YYYY, MM, DD if provided in the default value my $today = dt_from_string; -- 2.39.5