From: Bill Erickson Date: Tue, 1 Nov 2011 15:35:41 +0000 (-0400) Subject: Tpac; bookbag MARC retrieved via unapi X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Ftpac-bbag-record-via-unapi;p=working%2FEvergreen.git Tpac; bookbag MARC retrieved via unapi Make sure the bookbag interface has access to metabib.record_attr's by retrieving and parsing the marcxml via unapi (get_records_and_facets). Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index fe0da834f4..c84bed415d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1399,14 +1399,13 @@ sub load_myopac_bookbags { my $items = $U->bib_container_items_via_search($bookbag->id, $query) or return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; - # Maybe save a little memory by creating only one XML::LibXML::Document - # instance for each record, even if record is repeated across bookbags. + my (undef, @recs) = $self->get_records_and_facets( + [ map {$_->target_biblio_record_entry->id} @$items ], + undef, + {flesh => '{mra}'} + ); - foreach my $rec (map { $_->target_biblio_record_entry } @$items) { - next if $ctx->{bookbags_marc_xml}{$rec->id}; - $ctx->{bookbags_marc_xml}{$rec->id} = - (new XML::LibXML)->parse_string($rec->marc); - } + $ctx->{bookbags_marc_xml}{$_->{id}} = $_->{marc_xml} for @recs; $bookbag->items($items); }