Bugzilla – Attachment 156307 Details for
Bug 34549
The cataloguing editor allows you to input invalid data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34549: perltidy
Bug-34549-perltidy.patch (text/plain), 3.56 KB, created by
David Nind
on 2023-09-27 18:54:04 UTC
(
hide
)
Description:
Bug 34549: perltidy
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-09-27 18:54:04 UTC
Size:
3.56 KB
patch
obsolete
>From 83c7c56f6d8045f5a106b285bf1c60b031d0b44f Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 26 Sep 2023 04:58:54 +0000 >Subject: [PATCH] Bug 34549: perltidy > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Biblio.pm | 4 ++-- > t/db_dependent/Biblio/TransformHtmlToMarc.t | 11 +++++++---- > 2 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index e3c90d5244..4039f8f23a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2239,7 +2239,7 @@ sub TransformHtmlToMarc { > ; > # between 001 and 009 (included) > } elsif ( $fval ne '' ) { >- $fval = StripNonXmlChars($fval); #Strip out any non-XML characters like control characters >+ $fval = StripNonXmlChars($fval); #Strip out any non-XML characters like control characters > $newfield = MARC::Field->new( $tag, $fval, ); > } > >@@ -2261,7 +2261,7 @@ sub TransformHtmlToMarc { > $newfield->add_subfields( $fkey => $fval); > } > elsif($fval ne '') { >- $fval = StripNonXmlChars($fval); #Strip out any non-XML characters like control characters >+ $fval = StripNonXmlChars($fval); #Strip out any non-XML characters like control characters > $newfield = MARC::Field->new( $tag, $ind1, $ind2, $fkey => $fval ); > } > $j += 2; >diff --git a/t/db_dependent/Biblio/TransformHtmlToMarc.t b/t/db_dependent/Biblio/TransformHtmlToMarc.t >index 2670f29c82..0d54748031 100755 >--- a/t/db_dependent/Biblio/TransformHtmlToMarc.t >+++ b/t/db_dependent/Biblio/TransformHtmlToMarc.t >@@ -76,7 +76,7 @@ subtest 'Biblio record' => sub { > # A field (900) after 490 > $input->param( -name => "tag_900_indicator1_1123", -value => "" ); > $input->param( -name => "tag_900_indicator2_1123", -value => "" ); >- $input->param( -name => "tag_900_code_a_1123", -value => 'a' ); >+ $input->param( -name => "tag_900_code_a_1123", -value => 'a' ); > $input->param( -name => "tag_900_subfield_a_1123", -value => "This string has bad \x{1B}characters in it" ); > > my $record = C4::Biblio::TransformHtmlToMarc($input, 1); >@@ -100,7 +100,10 @@ subtest 'Biblio record' => sub { > > my @fields_900 = $record->field('900'); > is( @fields_900, 1, 'The record should have been created with 1 900' ); >- is_deeply( $fields_900[0]->subfields(), [ 'a', 'This string has bad characters in it' ], 'Field 900 had its non-XML characters stripped'); >+ is_deeply( >+ $fields_900[0]->subfields(), [ 'a', 'This string has bad characters in it' ], >+ 'Field 900 had its non-XML characters stripped' >+ ); > > my @subfields_biblionumber = $record->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); > is( @subfields_biblionumber, 1, 'The record should contain only one biblionumber field' ); >@@ -116,9 +119,9 @@ subtest 'Biblio record' => sub { > is( $all_fields[5]->subfield('a'), 42, 'Sixth field contains bibnumber' ); > is( $all_fields[6]->tag, '490', 'Last field is 490' ); > >- my $new_record = eval { MARC::Record::new_from_xml( $record->as_xml(), 'UTF-8' ); }; >+ my $new_record = eval { MARC::Record::new_from_xml( $record->as_xml(), 'UTF-8' ); }; > my $record_error = $@; >- ok( ! $record_error,'No errors parsing MARCXML generated by TransformHtmlToMarc'); >+ ok( !$record_error, 'No errors parsing MARCXML generated by TransformHtmlToMarc' ); > > }; > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34549
:
154479
|
154480
|
156198
|
156306
|
156307
|
156365