Bugzilla – Attachment 39806 Details for
Bug 12357
Enhancements to RIS and BibTeX exporting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12357 - Following whitespace failures on koha qa test tools.
Bug-12357---Following-whitespace-failures-on-koha-.patch (text/plain), 8.20 KB, created by
Jonathan Druart
on 2015-06-03 13:46:13 UTC
(
hide
)
Description:
Bug 12357 - Following whitespace failures on koha qa test tools.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-06-03 13:46:13 UTC
Size:
8.20 KB
patch
obsolete
>From decb2774267e1e445be74291f7ea3a09e21fcfde Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 25 May 2015 00:22:07 -0400 >Subject: [PATCH] Bug 12357 - Following whitespace failures on koha qa test > tools. > >TEST PLAN >--------- >1) Apply all patches before this. >2) run koha qa test tools > -- whitespace failures >3) Apply this patch >4) run koha qa test tools > -- no whitespace failures. > >NOTE: More tabs were fixed than required, to also clean up a little indenting. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Koha-qa tools now happy > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > C4/Record.pm | 42 +++++++++---------- > C4/Ris.pm | 104 ++++++++++++++++++++++++------------------------ > t/db_dependent/Record.t | 10 ++--- > 3 files changed, 78 insertions(+), 78 deletions(-) > >diff --git a/C4/Record.pm b/C4/Record.pm >index a3bc860..f46651b 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -326,27 +326,27 @@ sub marc2endnote { > if ($f500) { > $abstract = $f500->subfield('a'); > } >- my $fields = { >- DB => C4::Context->preference("LibraryName"), >- Title => $marc_rec_obj->title(), >- Author => $marc_rec_obj->author(), >- Publisher => $f710a, >- City => $f260a, >- Year => $marc_rec_obj->publication_date, >- Abstract => $abstract, >- }; >- my $endnote; >- my $style = new Biblio::EndnoteStyle(); >- my $template; >- $template.= "DB - DB\n" if C4::Context->preference("LibraryName"); >- $template.="T1 - Title\n" if $marc_rec_obj->title(); >- $template.="A1 - Author\n" if $marc_rec_obj->author(); >- $template.="PB - Publisher\n" if $f710a; >- $template.="CY - City\n" if $f260a; >- $template.="Y1 - Year\n" if $marc_rec_obj->publication_date; >- $template.="AB - Abstract\n" if $abstract; >- my ($text, $errmsg) = $style->format($template, $fields); >- return ($text); >+ my $fields = { >+ DB => C4::Context->preference("LibraryName"), >+ Title => $marc_rec_obj->title(), >+ Author => $marc_rec_obj->author(), >+ Publisher => $f710a, >+ City => $f260a, >+ Year => $marc_rec_obj->publication_date, >+ Abstract => $abstract, >+ }; >+ my $endnote; >+ my $style = new Biblio::EndnoteStyle(); >+ my $template; >+ $template.= "DB - DB\n" if C4::Context->preference("LibraryName"); >+ $template.="T1 - Title\n" if $marc_rec_obj->title(); >+ $template.="A1 - Author\n" if $marc_rec_obj->author(); >+ $template.="PB - Publisher\n" if $f710a; >+ $template.="CY - City\n" if $f260a; >+ $template.="Y1 - Year\n" if $marc_rec_obj->publication_date; >+ $template.="AB - Abstract\n" if $abstract; >+ my ($text, $errmsg) = $style->format($template, $fields); >+ return ($text); > > } > >diff --git a/C4/Ris.pm b/C4/Ris.pm >index d35b39e..cd56352 100644 >--- a/C4/Ris.pm >+++ b/C4/Ris.pm >@@ -817,36 +817,36 @@ sub get_keywords { > > ## loop over all 6XX fields > foreach my $kwfield (@keywords) { >- if ($kwfield != undef) { >- ## authornames get special treatment >- if ($fieldname eq "600") { >- my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1')); >- push @kw, $val; >- print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint; >- } >- else { >- ## retrieve all available subfields >- my @kwsubfields = $kwfield->subfields(); >- >- ## loop over all available subfield tuples >- foreach my $kwtuple (@kwsubfields) { >- ## loop over all subfields to check >- foreach my $subfield (@subfields) { >- ## [0] contains subfield code >- if (@$kwtuple[0] eq $subfield) { >- ## [1] contains value, remove trailing separators >- @$kwtuple[1] =~ s% *[,;.:/]*$%%; >- if (length(@$kwtuple[1]) > 0) { >- push @kw, @$kwtuple[1]; >- print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint; >- } >- ## we can leave the subfields loop here >- last; >- } >- } >- } >- } >- } >+ if ($kwfield != undef) { >+ ## authornames get special treatment >+ if ($fieldname eq "600") { >+ my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1')); >+ push @kw, $val; >+ print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint; >+ } >+ else { >+ ## retrieve all available subfields >+ my @kwsubfields = $kwfield->subfields(); >+ >+ ## loop over all available subfield tuples >+ foreach my $kwtuple (@kwsubfields) { >+ ## loop over all subfields to check >+ foreach my $subfield (@subfields) { >+ ## [0] contains subfield code >+ if (@$kwtuple[0] eq $subfield) { >+ ## [1] contains value, remove trailing separators >+ @$kwtuple[1] =~ s% *[,;.:/]*$%%; >+ if (length(@$kwtuple[1]) > 0) { >+ push @kw, @$kwtuple[1]; >+ print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint; >+ } >+ ## we can leave the subfields loop here >+ last; >+ } >+ } >+ } >+ } >+ } > } > return @kw; > } >@@ -940,28 +940,28 @@ sub pool_subx { > > ## loop over all notefields > foreach my $notefield (@notefields) { >- if (defined $notefield) { >- ## retrieve all available subfield tuples >- my @notesubfields = $notefield->subfields(); >- >- ## loop over all subfield tuples >- foreach my $notetuple (@notesubfields) { >- ## loop over all subfields to check >- foreach my $subfield (@subfields) { >- ## [0] contains subfield code >- if (@$notetuple[0] eq $subfield) { >- ## [1] contains value, remove trailing separators >- print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint; >- @$notetuple[1] =~ s% *[,;.:/]*$%%; >- if (length(@$notetuple[1]) > 0) { >- ## add to list >- push @{$aref}, @$notetuple[1]; >- } >- last; >- } >- } >- } >- } >+ if (defined $notefield) { >+ ## retrieve all available subfield tuples >+ my @notesubfields = $notefield->subfields(); >+ >+ ## loop over all subfield tuples >+ foreach my $notetuple (@notesubfields) { >+ ## loop over all subfields to check >+ foreach my $subfield (@subfields) { >+ ## [0] contains subfield code >+ if (@$notetuple[0] eq $subfield) { >+ ## [1] contains value, remove trailing separators >+ print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint; >+ @$notetuple[1] =~ s% *[,;.:/]*$%%; >+ if (length(@$notetuple[1]) > 0) { >+ ## add to list >+ push @{$aref}, @$notetuple[1]; >+ } >+ last; >+ } >+ } >+ } >+ } > } > } > >diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t >index 5dfa36a..8e806d7 100755 >--- a/t/db_dependent/Record.t >+++ b/t/db_dependent/Record.t >@@ -113,11 +113,11 @@ is ($bibtex, $test5xml, "testing bibtex"); > C4::Context->set_preference( "BibtexExportAdditionalFields", "'\@': 260\$b\ntest: 260\$b" ); > $bibtex = marc2bibtex( $marc, 'testID' ); > my $test6xml = qq(\@Scholastic{testID, >- author = {Rowling, J.K.}, >- title = {Harry potter}, >- publisher = {Scholastic}, >- year = {2001}, >- test = {Scholastic} >+\tauthor = {Rowling, J.K.}, >+\ttitle = {Harry potter}, >+\tpublisher = {Scholastic}, >+\tyear = {2001}, >+\ttest = {Scholastic} > } > ); > is( $bibtex, $test6xml, "testing bibtex" ); >-- >2.1.0
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 12357
:
28646
|
28647
|
28648
|
28649
|
28650
|
29291
|
29292
|
29293
|
29294
|
29295
|
29296
|
29297
|
31677
|
31678
|
31679
|
31680
|
33123
|
33124
|
33125
|
33126
|
35485
|
35487
|
35489
|
35826
|
35827
|
35828
|
38602
|
38604
|
39469
|
39471
|
39773
|
39774
|
39775
|
39776
|
39803
|
39804
|
39805
| 39806