Revert "Bug 21986: Do not escape quotation marks when cataloguing"

This reverts commit 7e21b1fd2d.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2019-02-27 09:43:28 +01:00
parent 28191756d1
commit b561c2dbd3
6 changed files with 11 additions and 1 deletions

View File

@ -136,6 +136,8 @@ sub create_input {
my $index_subfield = CreateKey(); # create a specifique key for each subfield
$value =~ s/"/&quot;/g;
# determine maximum length; 9999 bytes per ISO 2709 except for leader and MARC21 008
my $max_length = 9999;
if ($tag eq '000') {

View File

@ -281,6 +281,8 @@ sub create_input {
my $index_subfield = CreateKey(); # create a specifique key for each subfield
$value =~ s/"/&quot;/g;
# if there is no value provided but a default value in parameters, get it
if ( $value eq '' ) {
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue};

View File

@ -128,6 +128,7 @@ sub generate_subfield_form {
$subfield_data{repeatable} = $subfieldlib->{repeatable};
$subfield_data{maxlength} = $subfieldlib->{maxlength};
$value =~ s/"/&quot;/g;
if ( ! defined( $value ) || $value eq '') {
$value = $subfieldlib->{defaultvalue};
# get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value

View File

@ -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/\"/&quot;/g unless $key eq 'borrowernotes' or $key eq 'opacnote';
}
}

View File

@ -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/"/&quot;/g; # probably redundant w/ TMPL ESCAPE=JS
$template->param(clean_review=>$js_ok_review);
if ($savedreview) {
$savedreview->set(
{

View File

@ -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/"/&quot;/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;