Bugzilla – Attachment 14041 Details for
Bug 9274
Software error in bibtex export
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-9274-Software-error-in-bibtex-export.patch (text/plain), 1.89 KB, created by
Fridolin Somers
on 2012-12-12 14:51:58 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2012-12-12 14:51:58 UTC
Size:
1.89 KB
patch
obsolete
>From c418462d21891c451bce9169e13672aae27d7a34 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Wed, 12 Dec 2012 15:47:55 +0100 >Subject: [PATCH] Bug 9274: Software error in bibtex export > >--- > C4/Record.pm | 29 +++++++++++++++++++++++------ > 1 file changed, 23 insertions(+), 6 deletions(-) > >diff --git a/C4/Record.pm b/C4/Record.pm >index f75195f..ba2b259 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -647,18 +647,35 @@ C<$id> - an id for the BibTex record (might be the biblionumber) > sub marc2bibtex { > my ($record, $id) = @_; > my $tex; >+ my $marcflavour = C4::Context->preference("marcflavour"); > > # Authors >- my $marcauthors = GetMarcAuthors($record,C4::Context->preference("marcflavour")); > my $author; >- for my $authors ( map { map { @$_ } values %$_ } @$marcauthors ) { >- $author .= " and " if ($author && $$authors{value}); >- $author .= $$authors{value} if ($$authors{value}); >+ my @texauthors; >+ my ( $mintag, $maxtag, $fields_filter ); >+ if ( $marcflavour eq "UNIMARC" ) { >+ $mintag = "700"; >+ $maxtag = "712"; >+ $fields_filter = '7..'; > } >- >+ else { >+ $mintag = "700"; >+ $maxtag = "720"; >+ $fields_filter = '7..'; >+ } >+ foreach my $field ( $record->field($fields_filter) ) { >+ next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; >+ my $texauthor = join ' ', ( >+ $field->subfield('b'), >+ $field->subfield('a'), >+ ); >+ push @texauthors, $texauthor if $texauthor; >+ } >+ $author = join ' and ', @texauthors; >+ > # Defining the conversion hash according to the marcflavour > my %bh; >- if (C4::Context->preference("marcflavour") eq "UNIMARC") { >+ if ( $marcflavour eq "UNIMARC" ) { > > # FIXME, TODO : handle repeatable fields > # TODO : handle more types of documents >-- >1.7.9.5 >
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 9274
:
14041
|
14387
|
14631
|
14693
|
15527
|
15600
|
17059