Bugzilla – Attachment 3718 Details for
Bug 6076
acqui pdf error when marcxml wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-BZ7076-acqui-pdf-error-when-marcxml-wrong.patch (text/plain), 1.70 KB, created by
Paul Poulain
on 2011-04-05 21:13:06 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-04-05 21:13:06 UTC
Size:
1.70 KB
patch
obsolete
>From 90bf7fb0a95b8c42f4574071915d9206620ee056 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Tue, 5 Apr 2011 23:12:37 +0200 >Subject: [PATCH] BZ7076: acqui pdf error when marcxml wrong > >when marcxml is wrong the PDF is not generated. There is a Perl error because >the biblio can't be retrieved. >This can be workarounded with a eval when decoding the marc >--- > acqui/basketgroup.pl | 11 +++++++---- > 1 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl >index a92d730..5e50503 100755 >--- a/acqui/basketgroup.pl >+++ b/acqui/basketgroup.pl >@@ -225,10 +225,13 @@ sub printbasketgrouppdf{ > push(@ba_order, $bookseller->{gstrate}*100 // C4::Context->preference("gist") // 0); > # Editor Number > my $en; >- if (C4::Context->preference("marcflavour") eq 'UNIMARC') { >- $en = MARC::Record::new_from_xml($ord->{marcxml},'UTF-8')->subfield('345',"b"); >- } elsif (C4::Context->preference("marcflavour") eq 'MARC21') { >- $en = MARC::Record::new_from_xml($ord->{marcxml},'UTF-8')->subfield('037',"a"); >+ my $marcrecord=eval{MARC::Record::new_from_xml( $ord->{marcxml},'UTF-8' )}; >+ if ($marcrecord){ >+ if ( C4::Context->preference("marcflavour") eq 'UNIMARC' ) { >+ $en = $marcrecord->subfield( '345', "b" ); >+ } elsif ( C4::Context->preference("marcflavour") eq 'MARC21' ) { >+ $en = $marcrecord->subfield( '037', "a" ); >+ } > } > if($en){ > push(@ba_order, $en); >-- >1.7.1 >
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 6076
:
3718
|
4593