From ad41f88722874ebc7ccdc8f6154738ed2f370f43 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 22 Jan 2009 15:04:42 +0000 Subject: [PATCH] better support for handling detachment of last address git-svn-id: svn://svn.open-ils.org/ILS/trunk@11906 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/ue_config.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/ue_config.js b/Open-ILS/xul/staff_client/server/patron/ue_config.js index 807e829fe1..ca8909b5f3 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue_config.js +++ b/Open-ILS/xul/staff_client/server/patron/ue_config.js @@ -576,8 +576,13 @@ function uEditDeleteAddr( tbody, row, address, detach ) { } ) ); - if(!patron.addresses()) - patron.addresses([]); + if(!patron.addresses()) { + patron.addresses([]); + patron.billing_address(null); + patron.mailing_address(null); + patron.ischanged(1); + } + } else { address.isdeleted(1); @@ -587,10 +592,10 @@ function uEditDeleteAddr( tbody, row, address, detach ) { tbody.removeChild(row); var bid = patron.billing_address(); - bid = (typeof bid == 'object') ? bid.id() : bid; + bid = (bid != null && typeof bid == 'object') ? bid.id() : bid; var mid = patron.mailing_address(); - mid = (typeof mid == 'object') ? mid.id() : mid; + mid = (mid != null && typeof mid == 'object') ? mid.id() : mid; /* ----------------------------------------------------------------------- -- 2.11.0