From a649c656f2da120b330ebcadf3674d87d512a004 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 3 Sep 2020 13:32:46 -0400 Subject: [PATCH] LP#1857150: eg-fm-record-editor: handle unavailable linked values In some cases, a record editor might be handed a base object that has a linked column whose values cannot be retrieved because the user has permission to fetch the base object but not the linked objects. This patch makes the record editor more resilient in the face of that situation. Sponsored-by: Evergreen Community Development Initiative Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html | 2 +- Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html index e1ba382b63..8ca13dcdd7 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html @@ -50,7 +50,7 @@ - + {{field.linkedValues[0].label}} diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index 9a1a12efef..f6ff4418e8 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -428,7 +428,9 @@ export class FmRecordEditorComponent || this.idl.getClassSelector(class_) || idField; return list.map(item => { - return {id: item[idField](), label: item[selector]()}; + if (item !== undefined) { + return {id: item[idField](), label: item[selector]()}; + } }); } -- 2.11.0