From caef876670021fec21dd2e3a95951fd71c25233a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 9 Nov 2021 18:22:07 -0500 Subject: [PATCH] LP#1950394: isolate attribute extraction of metarecord This patch ensures that calling the Template Toolkit block get_marc_attrs() on the metarecord's lead record's MARCXML does not interfere with attributes already parsed from the current bib's MARCXML on the record summary page in the Bootstrap OPAC. This fixes an issue where electronic resource links could fail to be displayed under the following conditions: - the MARC record has an 856 field with ind1 = 4 and ind2 = 0 or 1 and is NOT a located URI - the bib is part of a metarecord set with at least one other member - the master record in the metarecord set does not have 856 fields To test ------- [1] Create a setup where two bibs are in the same metarecord set, one with 856 fields and one without. Arrange that the one without 856 fields is the lead record in the metarecord. [2] View the one that has 856 fields in the Bootstrap OPAC's record summary page. Note that the electronic resource links do not appear. [3] Apply the patch and repeat step 2. This time, the links should appear. Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 index a0007ed16f..13925be4a3 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 @@ -259,6 +259,9 @@ ctx.metalinks.push(' # l( 'mmr id = ' _ ctx.mmr_id ); # l( 'mmr data = ' _ ctx.mmr_data ); mmr_attrs = {marc_xml => ctx.mmr_data.marc_xml}; + save_args = args; # need to stash the original args + # until we're done processing the + # metarecord PROCESS get_marc_attrs args=mmr_attrs; IF args.mmr_unique_bib.size > 1; @@ -319,6 +322,7 @@ ctx.metalinks.push(' [%- END; END # ending tag for IF args.mmr_unique_bib.size > 1; %] + [% args = save_args; %] -- 2.11.0