Bug 33950: Don't get marcxml if not necessary - opac-readingrecord.pl

We are retrieving normalized_upc from the MARC XML in the controller (opac-readingrec.pl)
for all issues to display, but this is only used if BakerTaylor or Syndetics are enabled.

Test plan:
Have some checkouts and confirm that the checkout history is displayed
the same before and after this patch.
You should also test BakerTaylor or Syndetics and see if they are
working correctly, but I have no idea how to test them!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-06-08 10:14:33 +02:00 committed by Tomas Cohen Arazi
parent fac7bb247a
commit c4e016f4df
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 13 additions and 7 deletions

View File

@ -89,13 +89,19 @@ foreach my $issue ( @{$issues} ) {
getitemtypeimagelocation( 'opac',
$itemtypes->{ $issue->{$itype_attribute} }->{imageurl} );
}
my $marcxml = C4::Biblio::GetXmlBiblio( $issue->{biblionumber} );
if ( $marcxml ) {
$marcxml = StripNonXmlChars( $marcxml );
my $marc_rec =
MARC::Record::new_from_xml( $marcxml, 'UTF-8',
C4::Context->preference('marcflavour') );
$issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
if ( C4::Context->preference('BakerTaylorEnabled')
|| C4::Context->preference('SyndeticsEnabled')
|| C4::Context->preference('SyndeticsCoverImages') )
{
my $marcxml = C4::Biblio::GetXmlBiblio( $issue->{biblionumber} );
if ( $marcxml ) {
$marcxml = StripNonXmlChars( $marcxml );
my $marc_rec =
MARC::Record::new_from_xml( $marcxml, 'UTF-8',
C4::Context->preference('marcflavour') );
$issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
}
}
# My Summary HTML
if ($opac_summary_html) {