From c50802344eb266bfede284892de289c553cc8344 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 16 Sep 2021 11:24:39 -0400 Subject: [PATCH] LP1904036 Replace card correct deactivates current card Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index 15d29b36ad..5c02838dc6 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -1582,9 +1582,16 @@ export class EditComponent implements OnInit, AfterViewInit { replaceBarcode() { // Disable current card + if (this.patron.card()) { - this.patron.card().active('f'); - this.patron.card().ischanged(true); + // patron.card() is not the same in-memory object as its + // analog in patron.cards(). Since we're about to replace + // patron.card() anyway, just update the patron.cards() version. + const card = this.patron.cards() + .filter(c => c.id() === this.patron.card().id())[0]; + + card.active('f'); + card.ischanged(true); } const card = this.idl.create('ac'); -- 2.11.0