From 3bb027139f3a16979beb5bc9cb9d7de845134e5b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 17 Mar 2016 16:34:02 -0400 Subject: [PATCH] JBAS-1132 Save (Clone) from staged users repairs * Avoid trying to re-register the same staged patron after saving a staged patron and reloading the form. * Avoid trying to remove a staged patron from the pending user grid if the patron row has already been removed. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/actor/user/register.js | 3 +++ Open-ILS/xul/staff_client/server/patron/staged.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index a138930c67..47faa5282d 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -2285,6 +2285,9 @@ function uEditRemoveStage() { function uEditFinishSave(newPatron, doClone) { + if (xulG && xulG.params) + delete xulG.params.stage; // don't try to re-register + if(doClone && cloneUser == null) cloneUser = newPatron.id(); diff --git a/Open-ILS/xul/staff_client/server/patron/staged.js b/Open-ILS/xul/staff_client/server/patron/staged.js index 7d1a6d8b7d..90d59b2c10 100644 --- a/Open-ILS/xul/staff_client/server/patron/staged.js +++ b/Open-ILS/xul/staff_client/server/patron/staged.js @@ -201,6 +201,9 @@ function load( usrnames ) { function gen_on_save_handler(usrname) { return function() { try { + // avoid trying to remove the staged user twice. + if (!rows[usrname]) return; + var node = rows[ usrname ].treeitem_node; var parentNode = node.parentNode; parentNode.removeChild( node ); -- 2.11.0