From: Galen Charlton Date: Thu, 3 Sep 2020 17:32:46 +0000 (-0400) Subject: LP#1857150: eg-fm-record-editor: handle unavailable linked values X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6a073abec3fcdb1d75ae58f81ba63d7ba40d8a72;p=contrib%2FConifer.git 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 Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge --- 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]()}; + } }); }