From ac78db521c8fedab280a9505903c3b68b19c5b53 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 28 Feb 2019 00:11:22 +0000 Subject: [PATCH] Bug 22395: reverting 21986 This reverts commit e2cfc2615c119252e5c317059312c0d020f2924f. Signed-off-by: Lucas Gass --- authorities/authorities.pl | 2 ++ cataloguing/addbiblio.pl | 2 ++ cataloguing/additem.pl | 6 ++++-- members/memberentry.pl | 1 + opac/opac-review.pl | 3 +++ tools/batchMod.pl | 3 ++- 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index e422cafb36..9849232286 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 c4ed49da87..901892936b 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -275,6 +275,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} // q{}; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 8e4dbae3c3..7f4880f596 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -143,10 +143,12 @@ sub generate_subfield_form { my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); $value=~s/<>/$username/g; } + } else { + $value =~ s/"/"/g; } - + $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} <= -4)); - + my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) { my $CNtag = substr($pref_itemcallnumber, 0, 3); diff --git a/members/memberentry.pl b/members/memberentry.pl index 5a0818fe17..f6e4fe96a2 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -183,6 +183,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 741782963f..95cd69363c 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -341,7 +341,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