From 3ecef495d8268fdc966778e47309f326f32281e1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 15 Feb 2023 12:01:47 -0500 Subject: [PATCH] LP#2007351: fix the MARC editor heading linker for certain fields The headings linker in the Angular bib record editor could fail to retrieve the relevant authority control field metadata to determine what subfields in the bib record are controlled by a top-level authority record (as opposed to a subdivision record). This patch fixes this by adjusting the query for bib-to-authority linking relationships. This manifiested by the headings linker not consistently bringing up the headings browse when attemping to link headings in the bib 600, 600, 651, and 655 field.A To test: [1] Open a bib record in the Angular MARC editor and create a 650 field. [2] Click the button to open the headings linker. Note that no browse is performed. (This is not 100%, as the bug is sensitive to the exact order that the database happens to return rows from the authority.control_set_bib_field table.) [3] Apply the patch and repeat step 2. [4] This time, the browse list in the headings linker should show results. Signed-off-by: Galen Charlton Signed-off-by: Carol Witt --- .../marc-edit/authority-linking-dialog.component.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.ts index 0de369fdb0..cae1a55790 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.ts @@ -81,7 +81,21 @@ export class AuthorityLinkingDialogComponent }); this.pcrud.search('acsbf', - {tag: this.bibField.tag}, + { + tag: this.bibField.tag, + // we're only interested in the authority fields + // that are linked to a heading field; i.e., we're not + // interested in subdivision authorities at this time + authority_field: { + in: { + select: { acsaf: ['id'] }, + from: 'acsaf', + where: { + heading_field: { '!=' : null } + } + } + } + }, {flesh: 1, flesh_fields: {acsbf: ['authority_field']}}, {atomic: true, anonymous: true} -- 2.11.0