From b4fef8fde2dea7c0851618a651671f936620a6ca Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Tue, 16 Jan 2024 16:05:50 -0500 Subject: [PATCH] LP1582720: Ignore Duplicate Scoped URIs - BPAC When displaying scoped URI call numbers (subfield 9's), ignore duplicate URIs that can be caused by multiple subfield 9's on the same link. Release-note: (OPAC) Ignore duplicate links from 856 fields with multiple $9's Signed-off-by: Jason Boyer Signed-off-by: Jane Sandberg --- .../templates-bootstrap/opac/parts/misc_util.tt2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 index dd9671319b..b8a4fdbaa9 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2 @@ -571,7 +571,18 @@ res.link = res.note; res.note = ''; END; - args.uris.push(res); + + # Unique-ify the URI list because multiple $9's on the same link can cause dupes. + found_u = 0; + FOR test_u IN args.uris; + IF test_u.href == res.href AND test_u.link == res.link AND test_u.note == res.note; + found_u = 1; + LAST; + END; + END; + IF NOT found_u; + args.uris.push(res); + END; IF ebook_api.ebook_test.enabled == 'true'; IF !args.ebook_test_id; -- 2.43.2