From: Galen Charlton Date: Tue, 1 Sep 2020 14:52:50 +0000 (-0400) Subject: fm-edit: (SQUASH) deal with potential initialization sequence error X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f3e410324e9988431d12081ee62979ff27b2db64;p=working%2FEvergreen.git fm-edit: (SQUASH) deal with potential initialization sequence error Signed-off-by: Galen Charlton fm-edit: be more resilient in case linked values cannot be fleshed (as might happen in various permissions scenarios; for example, a user may be able to fetch providers but not the EDI default account associated with it) Signed-off-by: Galen Charlton --- 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 febb726673..e07da2eeda 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 109d6a17a9..9e0706ab58 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,8 @@ 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]()}; }); } @@ -624,7 +625,9 @@ export class FmRecordEditorComponent this.pcrud[this.mode]([recToSave]).toPromise().then( result => { this.recordSaved.emit(result); - this.fmEditForm.form.markAsPristine(); + if (this.fmEditForm) { + this.fmEditForm.form.markAsPristine(); + } this.successStr.current().then(msg => this.toast.success(msg)); if (this.isDialog()) { this.record = undefined; this.close(result); } },