From 96867ddd9735d45f49f1961c17d7f60e0bf1b600 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 20 Oct 2022 16:41:27 -0400 Subject: [PATCH] don't cross the streams with metabib related field names for the record and metabib variants of the catalog_summary call. This would otherwise break some links in search results involving bibs with metarecords. Signed-off-by: Jason Etheridge --- .../src/app/share/catalog/bib-record.service.ts | 10 ++++++---- .../bib-staff-view/bib-staff-view.component.html | 8 ++++---- .../lib/OpenILS/Application/Search/Biblio.pm | 22 +++++++++++++--------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts index 0bc02cd0c2..954906c10f 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts @@ -37,7 +37,9 @@ export class BibRecordSummary { id: number; // == record.id() for convenience metabibId: number; // If present, this is a metabib summary metabibRecords: number[]; // all constituent bib records - metabibAttributes: any; // combined attributes for metabib records; would be redundant with attributes if the BibRecordSummary is populated by a metarecord, and so is not populated in that case + staffViewMetabibId: number; // to supplement a record summary + staffViewMetabibRecords: number[]; // to supplement a record summary + staffViewMetabibAttributes: any; // to supplement a record summary orgId: number; orgDepth: number; record: IdlObject; @@ -129,9 +131,9 @@ export class BibRecordService { .pipe(map(bibSummary => { const summary = new BibRecordSummary(bibSummary.record, orgId); summary.net = this.net; // inject - summary.metabibId = Number(bibSummary.metabib_id); - summary.metabibRecords = bibSummary.metabib_records; - summary.metabibAttributes = bibSummary.metabib_attributes; + summary.staffViewMetabibId = Number(bibSummary.staff_view_metabib_id); + summary.staffViewMetabibRecords = bibSummary.staff_view_metabib_records; + summary.staffViewMetabibAttributes = bibSummary.staff_view_metabib_attributes; summary.display = bibSummary.display; summary.attributes = bibSummary.attributes; summary.holdCount = bibSummary.hold_count; diff --git a/Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.html b/Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.html index 471c35970b..9ea09d1800 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.html @@ -513,13 +513,13 @@
Formats and Editions:
    - -
  • + +
  • {{_x.key}} ({{_x.value}})
  • - -
  • + +
  • {{_x.key}} ({{_x.value}})
  • diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 593920b530..e7ed7c9550 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -3047,8 +3047,15 @@ __PACKAGE__->register_method( desc => q/ Stream of record summary objects including id, record, hold_count, copy_counts, display (metabib display - fields), attributes (metabib record attrs), plus - metabib_id and metabib_records for the metabib variant. + fields), and attributes (metabib record attrs). The + metabib variant of the call gets metabib_id and + metabib_records, and the regular record version also + gets some metabib information, but returns them as + staff_view_metabib_id, staff_view_metabib_records, and + staff_view_metabib_attributes. This is to mitigate the + need for code changes elsewhere where assumptions are + made when certain fields are returned. + / } } @@ -3112,15 +3119,12 @@ sub catalog_record_summary { # Let's get Formats & Editions data FIXME: consider peer bibs? unless ($is_meta) { - # metabib variant of this call already handle $response->{metabib_id} and $response->{metabib_records}, - # and $response->{metabib_attributes} would be redundant with $response->{attributes} in that case, so - # is not populated unless using the non-metarecord variants of the call my $meta_search = $e->search_metabib_metarecord_source_map({source => $rec_id}); if ($meta_search) { - $response->{metabib_id} = $meta_search->[0]->metarecord; - my $maps = $e->search_metabib_metarecord_source_map({metarecord => $response->{metabib_id}}); + $response->{staff_view_metabib_id} = $meta_search->[0]->metarecord; + my $maps = $e->search_metabib_metarecord_source_map({metarecord => $response->{staff_view_metabib_id}}); my @metabib_records = map { $_->source } @$maps; - $response->{metabib_records} = \@metabib_records; + $response->{staff_view_metabib_records} = \@metabib_records; my $attributes = $U->get_bre_attrs(\@metabib_records); # we get "243":{ @@ -3152,7 +3156,7 @@ sub catalog_record_summary { } } } - $response->{metabib_attributes} = $metabib_attr; + $response->{staff_view_metabib_attributes} = $metabib_attr; } } -- 2.11.0